Linux下使用Speedtest測試網速

來源:互聯網
上載者:User

Linux下使用Speedtest測試網速

導讀Speedtest是用來測試網路效能的開源軟體,在Linux下面安裝Speedtest可以用來測試網路出口的上傳和下載速度,協助排查網路方面導致的故障。

Speedtest介紹

由於公司幾個項目使用者訪問的時候響應較慢,項目本身沒問題,服務及調用的介面返回資訊都比較正常,猜想是網路方面造成的瓶頸,導致使用者請求的時候網路響應堵塞,拉長了回應時間。

Speedtest.net是比較廣泛的用來測試寬頻速度的網站,Speedtest.net的工作原理並不複雜:它在你的瀏覽器中載入JavaScript代碼並自動檢測離你最近的Speedtest.net伺服器,然後向伺服器發送HTTP GET and POST請求來測試上行/下行網速。

但在沒有圖形化案頭時(例如,當你通過命令列遠程登陸伺服器或使用沒有圖形介面的作業系統),基於flash、介面友好的Speedtest.net將無法工作。幸運的是,Speedtest.net提供了一個命令列版本——speedtest-cli。下面我將向你示範如何在Linux的命令列中使用speedtest-cli來測試寬頻連線速度。

安裝speedtest-cli

Github連結:https://github.com/sivel/speedtest-cli
Speendtest.net官網:http://www.speedtest.net/
測試本機所在網路出口的頻寬,訪問Speendtest.net,點擊首頁的Begin開始測試,等待幾秒,查看測試結果:

pip安裝

speedtest是用python寫的,沒使用過pip的需要先安裝pip,

pip安裝:https://pip.pypa.io/en/stable/installing/
#開啟epel源

yum install python-pip –y
安裝speedtest-cli
pip install speedtest-cli

安裝完成測試

which speedtest-cli | bash –

github安裝
pip install git+https://github.com/sivel/speedtest-cli.git

或者

git clone https://github.com/sivel/speedtest-cli.gitpython speedtest-cli/setup.py install
shell安裝
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.pychmod +x speedtest-cli./speedtest-cli
speedtest-cli使用
speedtest-cli –h/usr/bin/speedtest-cli –share/usr/bin/speedtest-cli –list

本文原創地址:http://www.linuxprobe.com/speedtest-network-in-linux.html


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.