Optimizing Netty for fast socket accept/creation

Carl Byström cgbystrom at gmail.com
Tue Jun 30 10:05:11 EDT 2009


Been experimenting some with Netty the last couple of days. As an avid MINA
fan, Netty looks great!
What's been bothering is the "slow" socket accept, which limits the
throughput of my application. (Request/response based ála HTTP 1.0, so no
keep-alive).
(The socket accept operation isn't "slow", I just feel that it could be
improved thus increasing my throughput)

After profiling my application I found that accept is taking up most of the
time. While this probably is as expected, I can't help feeling limited by
that fact.
I've tried having the same server listening on multiple ports thus getting a
separate boss thread doing the accept. This actually doubles the number of
req/s while retaining the same response time. I realize this isn't anything
peculiar (multi-core machine with another accept thread for it to chew on).
But it gets me thinking if there's more one can do to optimize this.

Is it possible to speed up the socket accept operation
a) by tuning Netty?
b) by tuning the JVM?
c) by tuning the OS/kernel?

While I fear things like this might be very sensitive to how the OS
implements the TCP stack, I hope at least there are some general advice or
places to start looking.
Appreciate any hints or tips regarding this. (Running on RHEL5 64-bit, Java
1.6.0_10-b33, Intel Quad-Core Q6600)

- Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20090630/4f2fc62b/attachment.html 


More information about the netty-users mailing list