General question about concurrent connections and Netty.

javadevmtl java.dev.mtl at gmail.com
Mon Jun 21 11:00:30 EDT 2010


Hi Trustin, it's quite hard to reproduce. As there to much business logic. I
have posted the code on pastebin.

The CPU spike doesn't seem to happen every time. And it doesn't really mean
anything to see something go up and down. It could be anything right? ;) And
it doesn't seem like the app is miss behaving because it still continues to
work...

I still think it's the test tool. I want anyone's opinion on this. I'm
testing with 2 different tools. JMeter and a custom tool done by another
team member.

With JMeter I see up to about 300 requests/responses per second (Includes
full business logic) with no failures.

With the custom tool I see up to about 140-150 request/responses per second
(Includes full business logic) with no failures.

The goal is 200 request/responses. But people are more convinced on the
custom tool then JMeter.

JMeter is setup with 50 threads(Users) and the Netty server can do the 300
request no problem and you can see the CPU maxing out at about 95% cpu so
the application is using the maximum resources of the server.

The custom tool creates x threads(Users) and uses the java ScheduledExecutor
to spread the requests over 1 second. So if the goal is 200 it means 1
request every 5 milliseconds but the cpu never reaches more then 60%
utilizations. The custom tools starts to fail with connection reset by peer
anywhere between 150-200 requests per second. So you can't max out the CPU.

I'm not a full expert but it seems that with JMeter setup up at 50 threads
you will never get more then 50 connections at a time. So if the response is
about 60ms, then you can do 50 * (1000/60) requests a second. While with the
custom tool you get a request every 5 milliseconds. But you would think that
a socket could handle more then a couple request per 5ms? Maybe netty is to
busy?

I have pasted the netty code just in case. But I doubt it will prove
anything. I'm just wondering what your thoughts on the above are?

Main: http://pastebin.com/KrwNxiPw
MessageEncoderDecoder: http://pastebin.com/8SGBmfR5
MyHandler: http://pastebin.com/dVmpawaj
MyHeaderDecoder: http://pastebin.com/KGtBUmsx
MyipelineFactory: http://pastebin.com/J4Cta5wN
ParentChannelHandler: http://pastebin.com/CXjkqDqW



-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/General-question-about-concurrent-connections-and-Netty-tp5179056p5204634.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list