服务器测速工具-Speedtest
网站简介
安装与使用:
[root@localhost ~]# wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py --2023-07-25 15:54:26-- https://raw.github.com/sivel/speedtest-cli/master/speedtest.py Resolving raw.github.com (raw.github.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ... Connecting to raw.github.com (raw.github.com)|185.199.110.133|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py [following] --2023-07-25 15:54:27-- https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 65334 (64K) [text/plain] Saving to: ‘speedtest.py’ 100%[===========================================================================================================================================>] 65,334 --.-K/s in 0.08s 2023-07-25 15:54:27 (800 KB/s) - ‘speedtest.py’ saved [65334/65334] [root@localhost ~]# ls speedtest.py [root@localhost ~]# chmod a+rx speedtest.py [root@localhost ~]# ls speedtest.py [root@localhost ~]# mv speedtest.py /usr/local/bin/speedtest-cli [root@localhost ~]# ls /usr/local/bin/speedtest-cli /usr/local/bin/speedtest-cli
测试:
[root@localhost ~]# speedtest-cli Retrieving speedtest.net configuration... Testing from China Unicom (221.11.26.50)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by China Telecom (Lanzhou) [505.69 km]: 24.256 ms Testing download speed................................................................................ Download: 52.20 Mbit/s (下载速度) Testing upload speed................................................................................................ Upload: 53.61 Mbit/ (上传速度)
它还可以自动生成一个图片链接,在浏览器以图片的形式把测速结果呈现出来:
[root@localhost ~]# speedtest-cli --shar Retrieving speedtest.net configuration... Testing from China Unicom (221.11.26.50)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by China Telecom AnHui 5G (Hefei) [822.94 km]: 29.911 ms Testing download speed................................................................................ Download: 42.00 Mbit/s Testing upload speed................................................................................................ Upload: 24.22 Mbit/s Share results: http://www.speedtest.net/result/15034042630.png (自动生成的图片链接)
命令使用详情:
-h, –help
|
show this help message and exit
|
–bytes
|
Display values in bytes instead of bits. Does not affect the image generated by –share
|
–share
|
Generate and provide a URL to the speedtest.net share results image
|
–simple
|
Suppress verbose output, only show basic information
|
–list
|
Display a list of speedtest.net servers sorted by distance
|
–server SERVER
|
Specify a server ID to test against
|
–mini MINI
|
URL of the Speedtest Mini server
|
–source SOURCE
|
Source IP address to bind to
|
–timeout TIMEOUT
|
HTTP timeout in seconds. Default 10
|
–secure
|
Use HTTPS instead of HTTP when communicating withspeedtest.net operated servers
|
–version
|
Show the version number and exit
|
OTLhxHRSjl