• 欢迎访问sadsu网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 最新版Git主题已支持说说碎语功能,可像添加文章一样直接添加说说,新建说说页面即可,最后重新保存固定连接,
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏sadsu吧

Speedtest-cli工具使用

VPS小知识 admin 4年前 (2016-09-26) 95次浏览 1个评论

 

window平台上可以用网页speedtest进行速度测试,

speedtest

我们Linux就是文本显示了,虽然不如图形直观,可是该测试的都没少。

安装speedtest-cli

1)pip install

打开一个终端,输入下面的命令:

yum install python-pip -y  ##已安装好pip的不用执行这一步
pip install --upgrade pip  ##已更新好pip的不用执行这一步 
pip install speedtest_cli

2)github安装

想要直接从github安装,你得这么做:

git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py install

然后就可以使用了

speedtest-cli -help

Usage: speedtest-cli [options]

Command line interface for testing internet bandwidth using speedtest.net.
————————————————————————–
https://github.com/sivel/speedtest-cli

Options:
-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 with
speedtest.net operated servers
–version Show the version number and exit

一般使用方法是先查看下list,一般选择你自己的城市,或者邻近的,但是最好是同一种网络(电信,移动,或者联通)

speedtest-cli --list|grep Shanghai

5083) Shanghai Branch, China Unicom (Shanghai, China) [11840.90 km]
9633) China Broadband Communications (Shanghai, China) [11840.90 km]

比如我使用的是上海电信,但是没有列表里只有联通的和中宽网信上海节点,那就换下国家看看

speedtest-cli --list|grep China

4525) Heilongjiang-CMCC (Harbin, China) [10250.43 km]
9484) China Unicom (Changchun, China) [10480.11 km]
5017) China Unicom,Liaoning Branch (Shenyang, China) [10743.69 km]
4713) China Mobile Group Beijing Co.Ltd (Beijing, China) [11239.54 km]
6302) Beijing Fiber City (Beijing, China) [11239.54 km]
5505) Beijing Broadband Network (Beijing, China) [11239.54 km]
5145) Beijing Unicom (Beijing, China) [11239.54 km]
4751) Beijing Telecom (Beijing, China) [11239.54 km]
6714) Tianjin Telecom (Tianjin, China) [11283.75 km]
5465) China Unicom (Hohhot, China) [11325.98 km]
8554) Xinjiang Wireless Communication Co., Ltd. (Changji, China) [11465.75 km]
3784) China Mobile Group Xinjiang Co.,Ltd. (Urumqi, China) [11488.11 km]
6144) xjunicom (Urumqi, China) [11488.11 km]
5039) China unicom Jinan branch (Jinan, China) [11532.73 km]
5083) Shanghai Branch, China Unicom (Shanghai, China) [11840.90 km]
9633) China Broadband Communications (Shanghai, China) [11840.90 km]
4595) China Telecom HeNan Branch (Zhengzhou, China) [11859.31 km]
5131) China unicom henan branch (Zhengzhou, China) [11859.31 km]
6810) HENAN UNICOM (Zhengzhou, China) [11859.31 km]
5122) China Mobile Group Jiangsu Co.,Ltd. (Wuxi, China) [11867.62 km]
3927) China Mobile Jiangsu Co., Ltd. (Suzhou, China) [11876.04 km]
5446) CHINA UNICOM JIANGSU COMPANY (Nanjing, China) [11897.16 km]
6245) ningbo unicom (Ningbo, China) [11962.56 km]
5509) Chinaunicom Ningxia branch (Ningxia, China) [11964.84 km]
5724) ChinaUnicom (Hefei, China) [11985.19 km]
4377) China Mobile Group Anhui Co.,Ltd (Hefei, China) [11985.19 km]
7509) China Telecom ZheJiang Branch (Hangzhou, China) [11998.48 km]
5300) Hangzhou , Zhejiang Unicom (Hangzhou, China) [11998.48 km]
8173) 5UFVPN (Hangzhou, China) [11998.48 km]
5992) Qinghai China Unicom (Xining, China) [12058.81 km]
3973) China Telecom (Lanzhou, China) [12068.37 km]
4690) China Unicom Lanzhou Branch Co.Ltd (Lanzhou, China) [12068.37 km]
5292) China Mobile Group Shaanxi Company Limited (Xi’an, China) [12090.60 km]
4863) Xi’an branch,Chinaunicom (Xi’an, China) [12090.60 km]
6435) china Telecom hubei branch (Xiangyang, China) [12195.85 km]
5485) China Unicom,Hubei Branch (Wuhan, China) [12247.03 km]
6345) ChinaTelecom.JiangXi (Nanchang, China) [12359.57 km]
7643) China Telecom.JiangXi.Network Center (Nanchang, China) [12359.57 km]
6473) jxtelecom (Nanchang, China) [12359.57 km]
5097) Chinaunicom.jx (Nanchang, China) [12359.57 km]
7230) China Unicom.JiangXi Co.,Ltd (Nanchang, China) [12359.57 km]
4884) China Unicom FuJian (Fuzhou, China) [12436.24 km]
6132) ChinaTelecom.Hunan (Changsha, China) [12541.17 km]
4870) Changsha, Hunan Unicom (Changsha, China) [12541.17 km]
2461) China Unicom (Chengdu, China) [12626.83 km]
4624) ChinaTelecom (Chengdu, China) [12626.90 km]
5506) china unicom (Xiamen, China) [12654.04 km]
6592) China Telecom Chongqing (Chongqing, China) [12658.47 km]
5726) China Unicom Chong Qing Branch (Chongqing, China) [12658.47 km]
5530) CCN (Chongqing, China) [12658.47 km]
7404) GuiYang Mobile Group chor (Guiyang, China) [12956.61 km]
5750) Lhasaunicom (Lhasa, China) [13023.02 km]
9151) ChinaTelecom-GZ (Guangzhou, China) [13026.52 km]
3891) Unicom-GZ (Guangzhou, China) [13026.52 km]
5081) ShenZhen Telecom (Shenzhen, China) [13042.47 km]
8170) Atombase Global Datamation (Hong Kong, China) [13061.74 km]
6852) FPT Telecom (Chai Wan, China) [13062.64 km]
1536) STC (Hong Kong, China) [13065.92 km]
2993) Website Solution Limited (Hong Kong, China) [13068.27 km]
8648) China Broadband Communications (Hong Kong, China) [13068.27 km]
6168) China Telecom (Kunming, China) [13259.14 km]
5674) GX-Unicom (Nanning, China) [13282.18 km]

 

最新补充,目前有上海电信节点了(3633),查询指令是

speedtest-cli --server=3633

用的是洛杉矶的测试机进行的测试,显示结果是:

[root@localhost ~]# speedtest-cli --server=3633
Retrieving speedtest.net configuration...
Testing from QuadraNet (192.161.xxx.xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by China Telecom (Shanghai) [10433.67 km]: 567.346 ms
Testing download speed................................................................................
Download: 13.81 Mbit/s
Testing upload speed....................................................................................................
Upload: 21.74 Mbit/s

 

 

 


极客公园 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Speedtest-cli工具使用
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. 不错,回去试试。
    nono2016-09-30 07:54 回复