Optimizing Netty for fast socket accept/creation

"이희승 (Trustin Lee)" trustin at gmail.com
Mon Jul 6 02:59:31 EDT 2009


Hi Carl,

Sorry for the late response first of all.

On 06/30/2009 11:05 PM, Carl Byström wrote:
> Been experimenting some with Netty the last couple of days. As an avid
> MINA fan, Netty looks great!

Thanks! :)

> 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)

Which Netty version are you using?  Netty uses only one thread for
accepting an incoming channel for each port, and it could be why it's
not performing good enough.  If you observe the accept performance issue
with 3.1.0.CR1, I'd like to fix it before GA.

Thanks!
Trusitn
> 
> - Carl
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users




More information about the netty-users mailing list