Most NIO frameworks can saturate 1 gigabit ethernet at some point. However, some frameworks can saturate the bandwidth with the smaller number of connections while others can not. The performance numbers of the 5 well-known open source NIO frameworks are presented here to help you figure out the excellence of Netty in performance.
If you are in a hurry, please scroll down to see the graphs first. You can also download the PDF document which contains detailed numbers and graphs.
Unlike usual expectations, NIO frameworks have different performance characteristics in spite of the fact that they are using the same NIO selector provider.
What’s observed is that the difference comes from the fundamental factors such as data structure and thread contention management, and those factors should never be overlooked.
Netty has succeeded to introduce the breakthrough in NIO framework performance with careful engineering, while retaining the flexible architecture.
A simple echo server and client exchange fixed length messages one by one (i.e. synchronous ping-pong). The handler code, which sends the received data back in verbatim, is executed in a separate thread pool that each NIO framework provides.
The tests were run with different message lengths (64 ~ 16384 bytes) and different network configurations (loopback and 1 gigabit ethernet), to see how well each framework performs on various conditions.
Executors.newFixedThreadPool() was used instead.-server -Xms2048m -Xmx2048m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethodsTCP_NODELAY was turned on. (i.e. Nagle’s algorithm was disabled.)11500 – no jumbo frame)The test client and servers ran on the same machine, Eden. (If images are not showing up, please refresh. There are three graphs here.)



The test client ran in Serpent, and the servers ran in Eden. (If images are not showing up, please refresh. There are three graphs here.)



The test result should be always reproduceable. Please give us your feed back to improve the accuracy of the test result. The full source code is available at the Subversion repository:
svn co http://anonsvn.jboss.org/repos/netty/subproject/benchmark
All tests run by Ant. Enter ‘ant -p‘ to see the instruction.
Post to del.icio.us