chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.88k stars 5.18k forks source link

性能测试,chargen,netty,ttcp等测试带宽大概897Mbps为什么比iperf3的 941 Mbits/sec要小一些 #678

Closed janksenhu closed 1 year ago

janksenhu commented 1 year ago

性能测试,chargen,netty,ttcp等测试带宽大概897Mbps为什么比iperf3的 941 Mbits/sec要小一些

ubuntu 16.04 1G网卡 交换机10G

采用example里面的demo测试,调整netty_discard_server 10个线程,3个client发送,基本持平到112 MiB/s (大概896Mbps),同样环境iperf3测试 941 Mbps,约差距45Mbps

chenshuo commented 1 year ago

112 MiB/s 是 112 1048576 8 = 939.5 Mbps.

janksenhu commented 1 year ago

正解,应该先算成bit,再除1000,以1000为进率

如果除1024为进率,就成了896Mbps,这种计算不公平 翻看iperf3的转换有类似,应该除1000为进率来转换

contrib/iperf3_to_gnuplot.py里面有类似转换 # to Gbits/sec round(float(ii.get('bits_per_second')) / (1000*1000*1000), 3),