互联网网络性能不佳,但 iperf3 结果完美无缺

互联网网络性能不佳,但 iperf3 结果完美无缺

我使用 Linux 系统作为路由器/防火墙,其内核如下:

Linux gentoo 6.0.8-gentoo-stripped-wireless #1 SMP PREEMPT_DYNAMIC Tue Nov 15 08:54:22 CST 2022 x86_64 AMD FX(tm)-8150 Eight-Core Processor AuthenticAMD GNU/Linux

如果需要,我可以提供 .config。

我正在使用以下 NIC:

0b:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

Settings for lan:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: slave
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: pumbg
        Wake-on: d
        Link detected: yes

06:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

Settings for wan:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

我能够运行 iperf3 并获得一致的高质量结果:

-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.10.10.5, port 49356
[  5] local 10.10.10.1 port 5201 connected to 10.10.10.5 port 49358
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   110 MBytes   919 Mbits/sec
[  5]   1.00-2.00   sec   112 MBytes   941 Mbits/sec
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec
[  5]   3.00-4.00   sec   111 MBytes   931 Mbits/sec
[  5]   4.00-5.00   sec   112 MBytes   941 Mbits/sec
[  5]   5.00-6.00   sec   112 MBytes   941 Mbits/sec
[  5]   6.00-7.00   sec   111 MBytes   928 Mbits/sec
[  5]   7.00-8.00   sec   112 MBytes   941 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   941 Mbits/sec
[  5]   9.00-10.00  sec   111 MBytes   930 Mbits/sec
[  5]  10.00-10.03  sec  3.08 MBytes   941 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.03  sec  1.09 GBytes   936 Mbits/sec                  receiver
-----------------------------------------------------------

但速度测试结果的峰值约为 700mbps,并且水平要低得多:

Retrieving speedtest.net configuration...
Testing from Spectrum (xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by xx (xx) [367.09 km]: 29.198 ms
Testing download speed................................................................................
Download: 305.14 Mbit/s
Testing upload speed......................................................................................................
Upload: 38.66 Mbit/s

我购买了 950/40,如果直接连接到调制解调器,就可以从我的台式机上获得该速度。使用 Raspberry Pi 4 作为路由器时,我遇到了性能问题,因为它处于省电模式,当带宽较高时,第一个 CPU 核心会被加载。我从未见过这个东西占用太多 CPU,所以我不认为这里会发生这种情况。我只是不知道为什么我可以直接在路由器/服务器上获得如此快的速度,从我的电脑到互联网,但不能从我的路由器/服务器到互联网或通过互联网获得如此快的速度。我可以调整什么来提高网络性能吗?我想不出是什么让它变慢了。

额外信息:

sysctl.conf

net.ipv4.ip_forward = 1

net.core.rmem_max = 16777216
net.core.wmem_max = 4194304

net.ipv4.tcp_rmem = 65535 131072 4194304
net.ipv4.tcp_wmem = 65535 131072 194304

我能够通过传输获得非常接近千兆位的速度,也许这是一个单流问题?我不确定。


我搬家了,插上所有东西,现在能获得千兆位。无法解释,但一位频谱工作人员拿着他们的手持式测速仪过来告诉我一定是我的设置导致了问题,我想事实并非如此,特定的电缆插孔/连接存在一些问题?我确保接触良好。真的想不出这该如何解释。

相关内容