局域网性能测试比本地性能测试降低了3.6倍

橘叔

本地测试

Running 30s test @ http://127.0.0.1/
  30 threads and 5000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    20.05ms    9.00ms 145.83ms   87.79%
    Req/Sec     8.49k     1.31k   66.26k    96.58%
  Latency Distribution
     50%   17.73ms
     75%   21.54ms
     90%   29.24ms
     99%   57.81ms
  7655483 requests in 30.09s, 0.95GB read
Requests/sec: 254383.05
Transfer/sec:     32.27MB

局域网测试


./wrk -c 5000 -d 10s -t 15 --latency http://192.168.3.26/
Running 30s test @ http://192.168.3.26/
  30 threads and 5000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   104.13ms  115.96ms   1.37s    83.78%
    Req/Sec     2.32k   274.59    10.39k    81.21%
  Latency Distribution
     50%   41.76ms
     75%  145.87ms
     90%  285.37ms
     99%  546.10ms
  2080851 requests in 30.07s, 263.93MB read
Requests/sec:  69189.15
Transfer/sec:  8.78MB

网速测试

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   997 MBytes   836 Mbits/sec    0             sender
[  5]   0.00-10.07  sec   997 MBytes   830 Mbits/sec                  receiver
[  7]   0.00-10.00  sec   996 MBytes   835 Mbits/sec    0             sender
[  7]   0.00-10.07  sec   996 MBytes   829 Mbits/sec                  receiver
[  9]   0.00-10.00  sec   958 MBytes   804 Mbits/sec    0             sender
[  9]   0.00-10.07  sec   958 MBytes   798 Mbits/sec                  receiver
[ 11]   0.00-10.00  sec   958 MBytes   804 Mbits/sec    0             sender
[ 11]   0.00-10.07  sec   958 MBytes   798 Mbits/sec                  receiver
[ 13]   0.00-10.00  sec   959 MBytes   804 Mbits/sec    0             sender
[ 13]   0.00-10.07  sec   958 MBytes   798 Mbits/sec                  receiver
[SUM]   0.00-10.00  sec  4.75 GBytes  4.08 Gbits/sec    0             sender
[SUM]   0.00-10.07  sec  4.75 GBytes  4.05 Gbits/sec                  receiver

各位大佬咨询一下,我使用webman在本地测试有24w的 QPS,但是在局域网测试的话就瞬间降低了3.6倍,网卡是万兆的网卡这问题会出现在什么地方?
压测机,和后台机器都有对内核进行优化

1337 3 0
3个回答

842461193

本地127.0.0.1不走网卡

  • 橘叔 2022-05-19

    谢谢大佬指点,我有疑问,万兆的网卡怎么会直接降低将近四倍的性能

  • 842461193 2022-05-19

    你走网卡就肯定有性能损耗啊,你ping下127.0.0.1和局域网ip看下延迟就知道了

six

压力机也是万兆网卡?

  • 橘叔 2022-05-19

    恩,两台都是万兆网卡

  • six 2022-05-19

    直接在本机用 http://192.168.3.26/ 压测下,如果还是差别这么大,就是走网卡导致的。如果出入不大,那可能是两台服务器间连接的路由器或者交换机问题,比如路由器或者交换机不是万兆出口的。还有网线可能不是万兆网线。

  • 橘叔 2022-05-20

    我本机压测192.168.3.26更快...
    Running 30s test @ http://192.168.3.26/
    30 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 9.36ms 8.17ms 227.75ms 61.70%
    Req/Sec 19.24k 6.40k 116.12k 65.69%
    Latency Distribution
    50% 9.15ms
    75% 13.68ms
    90% 20.06ms
    99% 31.92ms
    17418939 requests in 30.10s, 2.16GB read
    Requests/sec: 578610.94
    Transfer/sec: 73.39MB

  • six 2022-05-20

    那可以考虑压力机自身是否有问题。还有路由器、交换机、网线这些是否支持万兆带宽这些问题。

admin

这一看就是 路由器的问题,路由器处理不过来,买个5000块的华为交换机,肯定ok

  • 橘叔 2022-05-21

    机房网络用的交换机都是几万大洋的

年代过于久远,无法发表回答
×
🔝