ネットワーク速度をコマンドラインから見る方法
Webブラウザから、「速度」と検索して計測している皆さん、こんにちわ。 私はついに脱しました。
Ookla社という SpeedTest を提供している会社があります。Web上はとてもかっこよく速度を測れます。 http://gigazine.net/news/20061030_speedtest/
SpeedTest のコマンドラインツールも提供しています。 https://github.com/sivel/speedtest-cli
$ pip install speedtest-cli
計測
たくさんのサーバから自分の計測したい場所を選定できます。
$ speedtest --list | wc -l 6771 $ speedtest --list | grep Japan 14623) IPA CyberLab (Bunkyo, Japan) [2.57 km] 6492) denpa893 (Sumida, Japan) [6.13 km] 7510) ASEINet (Tokyo, Japan) [6.15 km] 12511) h3zjp (Nerima, Japan) [10.62 km] 8348) Foxcore-LS (Sodegaura, Japan) [24.56 km] 6508) at2wn (Yokohama, Japan) [28.67 km] 8407) Allied Telesis Capital Corporation (Sagamihara, Japan) [36.44 km] 6087) Allied Telesis Capital Corporation (Fussa-shi, Japan) [38.13 km] 7139) SoftEther Corporation (Tsukuba, Japan) [48.03 km] 14180) ClickL Network (Shizuoka, Japan) [146.99 km] 14515) CanopusAzusa (Nagaoka, Japan) [211.70 km] 14840) poteitoo (Nagoya, Japan) [263.76 km] 6766) JAIST(ino-lab) (Nomi, Japan) [300.32 km] 8193) kamiari (Sendai, Japan) [303.68 km] 6368) gatolabo (Maibara, Japan) [316.59 km] 13641) NextechNetworkSolutions (Nara, Japan) [375.45 km] 6476) rxy (individual) (Osaka, Japan) [401.52 km] 8832) prize3046 (Ikeda, Japan) [403.98 km] 6477) satoweb (Sakai, Japan) [407.33 km] 6405) Allied Telesis Capital Corporation (Misawa, Japan) [573.40 km] 7976) denpa893 (Hikari, Japan) [737.90 km] 14277) cloudremix (Kitakyushu, Japan) [834.67 km] 811) GLBB Japan KK (Chatan, Japan) [1543.58 km] 6581) haza (Haebaru, Japan) [1556.20 km]
何も指定せずに、適当に実行
$ speedtest Retrieving speedtest.net configuration... Testing from XXXXX Networks Corporation (XXX.XXX.XXX.XXX)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by h3zjp (Nerima) [10.62 km]: 18.193 ms Testing download speed.........................................^[....................................... Download: 143.70 Mbit/s Testing upload speed...................................................................................................... Upload: 118.85 Mbit/s
一番近いところ
$ speedtest --list | grep 14623 14623) IPA CyberLab (Bunkyo, Japan) [2.57 km] $ speedtest --server 14623 Retrieving speedtest.net configuration... Testing from XXXXX Networks Corporation (XXX.XXX.XXX.XXX)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by IPA CyberLab (Bunkyo) [2.57 km]: 10.869 ms Testing download speed................................................................................ Download: 210.02 Mbit/s Testing upload speed...................................................................................................... Upload: 125.55 Mbit/s
Brazil とか
$ speedtest --list | grep 10458 10458) UltraNet Telecomunicações - Curitibanos (Curitibanos, Brazil) [18664.67 km] $ speedtest --server 10458 Retrieving speedtest.net configuration... Testing from XXXXX Networks Corporation (XXX.XXX.XXX.XXX)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by UltraNet Telecomunicações - Curitibanos (Curitibanos) [18664.67 km]: 380.543 ms Testing download speed................................................................................ Download: 13.14 Mbit/s Testing upload speed...................................................................................................... Upload: 11.54 Mbit/s
距離に応じて速度は変わりましたね