{"id":2232,"date":"2008-10-06T12:16:49","date_gmt":"2008-10-06T12:16:49","guid":{"rendered":"http:\/\/t.motd.kr\/articles\/2232\/performance-comparison-between-nio-frameworks"},"modified":"2022-12-28T01:45:32","modified_gmt":"2022-12-27T16:45:32","slug":"performance-comparison-between-nio-frameworks","status":"publish","type":"post","link":"https:\/\/vault.motd.kr\/wordpress\/posts\/2232\/performance-comparison-between-nio-frameworks\/","title":{"rendered":"Performance Comparison between NIO Frameworks"},"content":{"rendered":"\n
Most NIO<\/span> 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<\/span> frameworks are presented here to help you figure out the excellence of Netty<\/a> in performance.<\/p>\n\n\n\n If you are in a hurry, please scroll down to see the graphs first. You can also download the PDF<\/span> document<\/a> which contains detailed numbers and graphs.<\/p>\n\n\n\n Unlike usual expectations, NIO<\/span> frameworks have different performance characteristics<\/strong> in spite of the fact that they are using the same NIO<\/span> selector provider.<\/p>\n\n\n\n What\u2019s observed is that the difference comes from the fundamental factors<\/strong> such as data structure and thread contention management, and those factors should never be overlooked.<\/p>\n\n\n\n Netty<\/a> has succeeded to introduce the breakthrough in NIO<\/span> framework performance with careful engineering, while retaining the flexible architecture.<\/p>\n\n\n\n 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<\/span> framework provides.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n The test client and servers ran on the same machine, Eden. (If images are not showing up, please refresh. There are three graphs here.)<\/p>\n\n\n\nWhere\u2019s the Graph?<\/h3>\n\n\n\n
What\u2019s the Bottom Line?<\/h3>\n\n\n\n
Test Scenario<\/h3>\n\n\n\n
Test Environment<\/h3>\n\n\n\n
\n
\n
\n
\n
\n
Executors.newFixedThreadPool()<\/code> was used instead.<\/li>\n<\/ul>\n<\/li>\n\n\n\n
-server -Xms2048m -Xmx2048m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n
\n
\n
\n
\n
TCP_NODELAY<\/code> was turned on. (i.e. Nagle\u2019s algorithm was disabled.)<\/li>\n\n\n\n
1<\/code><\/li>\n\n\n\n
1500<\/code> \u2013 no jumbo frame)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n
Test Result<\/h3>\n\n\n\n
Client and Server on the Same Machine (Loopback Device)<\/h4>\n\n\n\n