手记

Web Socket 性能对比——Spring Boot vs Tomcat vs Netty

统计结果精确到5位小数;每次请求都预热过了

等待上一个消息响应后再发送下一个消息

实现方式消息类型消息长度发送消息数总耗时(s)Messages/s单方向单次耗时(ms)吞吐(MChars/s单方向)
Spring BootText10010000032.3583090.425860.323580.30904
TomcatText10010000030.2763302.946230.302760.33029
NettyText10010000025.0913985.49280.250910.39855
----------------
Spring BootText102410000019.5025127.679210.195025.25074
TomcatText102410000017.2095810.912890.172095.95037
NettyText102410000014.187052.186180.14187.22144
----------------
Spring BootText409610000043.6152292.789180.436159.39126
TomcatText409610000042.492353.494940.42499.63992
NettyText409610000036.42747.252750.36411.25275

发送全部消息,然后等待所有结果

实现方式消息类型消息长度发送消息数总耗时(s)Messages/s单方向单次耗时(ms)吞吐(MChars/s单方向)
Spring BootText1001000008.20712184.720360.082071.21847
TomcatText1001000008.15212266.928360.081521.22669
NettyText1001000007.1114064.697610.07111.40647
----------------
Spring BootText102410000012.547974.481660.125398.16587
TomcatText102410000012.118257.638320.12118.45582
NettyText102410000010.559478.672990.10559.70616
----------------
Spring BootText409610000024.4544089.310540.2445416.74982
TomcatText409610000024.1324143.875350.2413216.97331
NettyText409610000021.5834633.276190.2158318.97789



作者:我是杨正
链接:https://www.jianshu.com/p/3615a0114694


0人推荐
随时随地看视频
慕课网APP