技術(shù)文檔
Speedtest測(cè)試網(wǎng)絡(luò)上傳/下載速度還是挺不錯(cuò)的,windows下非常方便。Linux下也可以很方便的使用命令行speedtest來(lái)測(cè)試。speedtest是一個(gè)用Python編寫(xiě)的輕量級(jí)Linux命令行工具,在Python2.4至3.4版本下均可運(yùn)行。它基于Speedtest.net的基礎(chǔ)架構(gòu)來(lái)測(cè)量網(wǎng)絡(luò)的上/下行速率。安裝speedtest很簡(jiǎn)單只需要下載其Python腳本文件。
wget http://down.wshost.cc/SH/speedtest.pychmod a+rx speedtest.pymv speedtest.py /usr/local/bin/speedtestchown root:root /usr/local/bin/speedtest
執(zhí)行以上幾個(gè)命令就安裝好了,然后運(yùn)行的時(shí)候只要輸入 speedtest
[root@hongkong-k8s-node02 ~]# speedtest Retrieving speedtest.net configuration... Testing from Alibaba (47.75.223.169)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by China Mobile Group Beijing Co.Ltd (Beijing) [1.67 km]: 41.884 ms Testing download speed................................................................................ Download: 135.38 Mbit/s Testing upload speed................................................................................................ Upload: 1.97 Mbit/s
如果你對(duì)目前所有可用的Speedtest.net服務(wù)器感興趣,你可以使用參數(shù)--list。它會(huì)打印出所有的Speedtest.net服務(wù)器(按照離你的地理距離由近及遠(yuǎn)排序)。
speedtest --list
在上面的列表中,每一行前面都有一個(gè)與服務(wù)器對(duì)應(yīng)的ID。如果想使用指定的節(jié)點(diǎn)來(lái)測(cè)試你的網(wǎng)速,你只需要在speedtest命令后指定其ID即可。例如,如果想使用上圖中的QuadraNet服務(wù)器,你只需要指定相對(duì)應(yīng)的服務(wù)器ID7456即可。
speedtest --server 7456