Need help with load using akka.http or netty.http

Hi @bradrust,

indeed 100 requests/sec seem low. On that scale there should be no difference between akka-http and netty.

Have you tried profiling your application while the load test is running? Could you just do jstack <pid> while running the gatling test and post the output here?

Is your load test using persistent HTTP connections? Or is it opening new connections all the time?

The most common error that leads to bad performance is running into thread starvation because of running blocking code in your service handlers on the main dispatcher. Are you calling mongo with asynchronous APIs? If not, do you run the mongo calls on a dedicated dispatcher? A quick jstack can already confirm these kinds of issues.

A main reason the akka-http backend might show different behavior in that regard compared to netty is that the netty backend spawns its own thread pool. Altogether there might be more threads available for all the work to do and you might be able to achieve greater parallelism even in the presence of blocking code. With the akka-http backend there might only be the default dispatchers which has only limited threads, which is optimal if you don’t run blocking code. With blocking code, all the threads might be busy waiting for mongo and not being able to accept or handle any more HTTP connections.

So the first step is to confirm or rule out thread starvation issues.

Johannes

1 Like