Handling large sized requests in RestExpress with high throughput

57 views
Skip to first unread message

Kapil Aggarwal

unread,
Sep 29, 2016, 9:18:52 AM9/29/16
to RestExpress

Hi,


I am trying to upload large sized requests (streams) using RestExpress and am trying to scale up my application. It works excellent when I put a load of upto 250 parallel users but the throughput drops drastically when the load is increased to 1000 users. The server is 4 core 16 GB machine.

I tried with 8 boss threads and 1000 worker threads. Now, I have 2000 boss threads and 10000 worker threads.

Todd Fredrich

unread,
May 4, 2017, 3:33:15 PM5/4/17
to RestExpress
Hi Kapil,

There's a lot that goes into tuning a server for throughput. If there is a drastic drop-off in performance with increased users and boss/worker threads don't fix it, the machine may be out of ephemeral ports, the process might be starved for memory (perhaps with long GC pauses, etc.), or RestExpress isn't suited to your use case. I'd look at the ephemeral ports for the process first. And confirm GC config so that the JVM has enough memory and is using an appropriate garbage collector for your use case.  RestExpress isn't necessarily the best for large requests (I don't know how big you're talking) since it reads the entire request into memory before forwarding it to your controller. It works well for "normal" (e.g. < 50K) JSON payloads.  If the above doesn't help your throughput, you might try writing a bare Netty server.

Good Luck!
--Todd
Reply all
Reply to author
Forward
0 new messages