Concurrent execution problem with ExecutionHandler

Carl Byström cgbystrom at gmail.com
Mon Dec 7 16:05:55 EST 2009


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().
An ExecutionHandler has, together with an
OrderedMemoryAwareThreadPoolExecutor been put in the pipeline yet I don't
see the concurrent execution I want.

Used ApacheBench to benchmark. Tried the following ab -n 100 -c 100
http://127.0.0.1:8080/ which would do a total of 100 requests simultaneously
to the server.
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.

Trying the same ab but with -n 50 -c 50 works as expected, finishes in one
second.
Feels like somethings up with the thread pools and the execution.
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.

Code is available here http://gist.github.com/251077
(It's fully runnable, but with only one public class)

Anybody know what's causing this?

--
Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20091207/72a2c8de/attachment.html 


More information about the netty-users mailing list