I'm prototyping a simple application in Netty. In this simple app I've tried to simulate slow back-end I/O (such as database calls) through a Thread.sleep().<br>An ExecutionHandler has, together with an OrderedMemoryAwareThreadPoolExecutor been put in the pipeline yet I don't see the concurrent execution I want.<br>
<br>Used ApacheBench to benchmark. Tried the following ab -n 100 -c 100 <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080/</a> which would do a total of 100 requests simultaneously to the server.<br>I expect this test to finish in about 1 second (as my sleep is 1000 ms) but somehow it's taking twice as long. Only yielding 50 req/s.<br>
<br>Trying the same ab but with -n 50 -c 50 works as expected, finishes in one second.<br>Feels like somethings up with the thread pools and the execution.<br>Have a legacy server in MINA that do lots of blocking I/O in the "business layer" with no problems. Hopefully it's just some negligence from my side causing this.<br>
<br>Code is available here <a href="http://gist.github.com/251077">http://gist.github.com/251077</a><br>(It's fully runnable, but with only one public class) <br><br>Anybody know what's causing this?<br><br>--<br>
Carl<br>