我有一个问题,关于如何测量我服务器的下载速度。基本上,我在 Namecheap 有一个专用服务器,我购买了 1GBps 端口速度。(不是广告)。但当我运行时,speedtest-cli
我从未获得超过 300 Mbits/s 的速度。但我看到论坛上有人将 IP 达到 900 Mbits/s。而且服务器speedtest-cli
距离只有 45 公里。
我和他们讨论了这个问题,他们说测量下载速度的最佳方法是使用iperf
。他们得到了以下结果:
------------------------------------------------------------
Client connecting to 199.188.200.101, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[ 11] local port 47152 connected with 199.188.200.101 port 5001
[ 4] local port 47143 connected with 199.188.200.101 port 5001
[ 12] local port 47151 connected with 199.188.200.101 port 5001
[ 5] local port 47145 connected with 199.188.200.101 port 5001
[ 8] local port 47148 connected with 199.188.200.101 port 5001
[ 10] local port 47150 connected with 199.188.200.101 port 5001
[ 9] local port 47149 connected with 199.188.200.101 port 5001
[ 7] local port 47146 connected with 199.188.200.101 port 5001
[ 6] local port 47147 connected with 199.188.200.101 port 5001
[ 3] local port 47144 connected with 199.188.200.101 port 5001
[ ID] Interval Transfer Bandwidth
[ 6] 0.0-10.0 sec 92.4 MBytes 77.4 Mbits/sec
[ 4] 0.0-10.0 sec 35.6 MBytes 29.8 Mbits/sec
[ 9] 0.0-10.0 sec 242 MBytes 202 Mbits/sec
[ 3] 0.0-10.0 sec 68.0 MBytes 56.9 Mbits/sec
[ 12] 0.0-10.0 sec 59.4 MBytes 49.6 Mbits/sec
[ 5] 0.0-10.0 sec 95.1 MBytes 79.5 Mbits/sec
[ 8] 0.0-10.1 sec 110 MBytes 91.9 Mbits/sec
[ 10] 0.0-10.1 sec 85.8 MBytes 71.5 Mbits/sec
[ 11] 0.0-10.1 sec 86.1 MBytes 71.7 Mbits/sec
[ 7] 0.0-10.1 sec 60.2 MBytes 50.1 Mbits/sec
[SUM] 0.0-10.1 sec 934 MBytes 777 Mbits/sec
但事实是,当人们下载东西时,他们从来不会打开几个端口来下载。为什么我的服务器在同一个测试中与其他服务器不匹配。似乎有些不对劲。有人能告诉我他们提供的数据是否证明我的服务器是 1GBps?还是我被骗了?
更新:
我的结果
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (******)...
Selecting best server based on ping...
Hosted by KanOkla Networks (Caldwell, KS) [120.08 km]: 29.723 ms
Testing download speed........................................
Download: 306.43 Mbits/s
Testing upload speed..................................................
Upload: 34.66 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (***)...
Selecting best server based on ping...
Hosted by IdeaTek Systems (Buhler, KS) [69.02 km]: 8.663 ms
Testing download speed........................................
Download: 160.10 Mbits/s
Testing upload speed..................................................
Upload: 37.91 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (***)...
Selecting best server based on ping...
Hosted by Sumner Communications (Wellington, KS) [88.77 km]: 23.047 ms
Testing download speed........................................
Download: 27.94 Mbits/s
Testing upload speed..................................................
Upload: 21.71 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by KsFiberNet (Wichita, KS) [45.26 km]: 29.723 ms
Testing download speed........................................
Download: 131.05 Mbits/s
Testing upload speed..................................................
Upload: 31.58 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by IdeaTek Systems (Buhler, KS) [69.02 km]: 8.98 ms
Testing download speed........................................
Download: 277.10 Mbits/s
Testing upload speed..................................................
Upload: 37.58 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
python speedtest-cliRetrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by IdeaTek Systems (Buhler, KS) [69.02 km]: 8.98 ms
Testing download speed........................................
Download: 138.62 Mbits/s
Testing upload speed..................................................
Upload: 37.42 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by IdeaTek Systems (Buhler, KS) [69.02 km]: 8.901 ms
Testing download speed........................................
Download: 137.41 Mbits/s
Testing upload speed..................................................
Upload: 36.51 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by Sumner Communications (Wellington, KS) [88.77 km]: 8.265 ms
Testing download speed........................................
Download: 32.07 Mbits/s
Testing upload speed..................................................
Upload: 20.07 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by IdeaTek Systems (Buhler, KS) [69.02 km]: 8.583 ms
Testing download speed........................................
Download: 179.43 Mbits/s
Testing upload speed..................................................
Upload: 33.49 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by KanOkla Networks (Caldwell, KS) [120.08 km]: 8.98 ms
Testing download speed........................................
Download: 127.67 Mbits/s
Testing upload speed..................................................
Upload: 24.39 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by Sumner Communications (Wellington, KS) [88.77 km]: 30.279 ms
Testing download speed........................................
Download: 30.61 Mbits/s
Testing upload speed..................................................
Upload: 20.45 Mbits/s
root@NC-PH-0471-11:~# python speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Namecheap (*****)...
Selecting best server based on ping...
Hosted by KsFiberNet (Wichita, KS) [45.26 km]: 8.663 ms
Testing download speed........................................
Download: 130.36 Mbits/s
Testing upload speed..................................................
Upload: 28.73 Mbits/s
答案1
您购买了一台带有千兆以太网端口的机器。这意味着此时的带宽为 1 gbps。这是合并进出服务器的所有流量的带宽。
你观察到的 300mbps 至少证明该机器具有 1gbps 以太网连接;因为下一个最高链接速度(假设有线以太网)是 100mbps,您已经超过了这个速度。除此之外,没有什么可说的。
您发布了他们的结果,但没有发布您自己的结果;您是否也尝试了多个 Speedtest 服务器 ID?而且,这可能是一件愚蠢的事情,但请确保您是从服务器运行 speedtest-cli,而不是无意中从本地计算机运行它。
您提到 speedtest-cli 根据 ping 时间来选择服务器。Ping 时间表示延迟,而不是带宽。Speedtest 服务器和您的服务器之间的带宽小于 1gbps 是合理的。您可能希望有多个速度测试服务器同时进行带宽检查,然后将它们全部加在一起;这就是他们执行的测试。
请记住,1gbps 端口速度主要帮助多个用户同时使用您的网站而不会互相影响,因为单个用户不太可能获得 1gbps 的持续服务器连接。单台服务器的 Speedtest 不是完成这项工作的合适工具。
顺便说一句,如果您的服务器运行的是 Linux,您可以直接验证以太网链接速度。首先查看ifconfig
接口名称(通常是 eth0 或类似名称),然后使用ethtool
显示有关接口的信息,其中包括硬件链接速度。