サーバー側の回線速度測定方法と各社serverの比較(speedtest-cli)

サーバー側の回線速度を測定する方法と各社の比較(speedtest-cli) サーバー

PCやスマホではブラウザやアプリで簡単に回線速度の測定が行えますが、サーバーなどのCUI環境で簡単に使えるspeedtest-cliを利用してサーバー側の回線速度の測定を行う方法を解説します。

ついでに代表的なVPSサービスやクラウドサービスの回線速度比較もしてみました。

【動作確認環境】
CentOS 7.6

speedtest-cliのインストール

epelリポジトリを利用するのでepel-releaseをインストールします。

# yum install epel-release

python-pipをインストールします。

# yum --enablerepo=epel install python-pip
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                             
 * elrepo: ftp.ne.jp
 * epel: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
epel                                                                                             
(1/2): epel/x86_64/updateinfo                                                                    
(2/2): epel/x86_64/primary_db                                                                    
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ python2-pip.noarch 0:8.1.2-7.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

=================================================================================================
 Package                           アーキテクチャー             バージョン                       
=================================================================================================
インストール中:
 python2-pip                       noarch                       8.1.2-7.el7                      

トランザクションの要約
=================================================================================================
インストール  1 パッケージ

総ダウンロード容量: 1.7 M
インストール容量: 7.2 M
Is this ok [y/d/N]: y
Downloading packages:
python2-pip-8.1.2-7.el7.noarch.rpm                                                               
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : python2-pip-8.1.2-7.el7.noarch                                       
  検証中                  : python2-pip-8.1.2-7.el7.noarch                                       

インストール:
  python2-pip.noarch 0:8.1.2-7.el7                                                               

完了しました!

pipをアップデートします。

# pip install pip --upgrade
Collecting pip
  Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 620kB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-19.0.3

pipでspeedtest-cliをインストールします。

# pip install speedtest-cli
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your tained after that date. A future version of pip will drop support for Python 2.7.
Collecting speedtest-cli
  Downloading https://files.pythonhosted.org/packages/61/8b/58d1de9a7fff3e91c5ab956ab4ba72b49f42dcli-2.1.1-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-2.1.1

以上でspeedtest-cliのインストールは完了です。

回線速度を測定

回線速度測定方法

回線速度を測定する方法は speedtest-cli と打ち込んでEnterキーを叩くだけです。

# speedtest-cli
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (163.43.xxx.xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by poteitooo (Nagoya) [137.73 km]: 11.694 ms
Testing download speed................................................................................
Download: 222.99 Mbit/s
Testing upload speed................................................................................................
Upload: 98.45 Mbit/s

ダウンロード速度が222.99 Mbit/s、アップロード速度が98.45 Mbit/sだと判明しました。

この測定結果はWebサーバー上で回線速度測定を実行した速度なので、サイト閲覧者にとってはWebサーバーのダウンロード速度がアップロードの速度、Webサーバーのアップロード速度がダウンロードの速度というように逆の意味になります。

回線速度測定サーバーの指定

回線速度測定サーバーの指定も可能です。

speedtest-cli --list で測定サーバーの一覧が表示されます。(数が多いのでgrepを使って日本国内で絞り込みました。)

# speedtest-cli --list | grep Japan
 6476) rxy (individual) (Osaka, Japan) [1.90 km]
 6368) gatolabo (Maibara, Japan) [98.61 km]
19038) poteitooo (Nagoya, Japan) [137.73 km]
 6766) JAIST(ino-lab) (Nomi, Japan) [215.30 km]
 8407) Allied Telesis Capital Corporation (Sagamihara, Japan) [363.83 km]
 6087) Allied Telesis Capital Corporation (Fussa-shi, Japan) [365.33 km]
 6508) at2wn (Yokohama, Japan) [384.01 km]
15047) OPEN Project (via 20G SINET) (Tokyo, Japan) [394.11 km]
20976) GLBB Japan (Tokyo, Japan) [394.11 km]
21569) i3D.net (Tokyo, Japan) [394.11 km]
18516) GIAM PING VIETPN.COM (Tokyo, Japan) [394.11 km]
19256) Love4Taylor (Tokyo, Japan) [394.11 km]
14623) IPA CyberLab (Bunkyo, Japan) [400.84 km]
14515) CanopusAzusa (Nagaoka, Japan) [428.59 km]
 7139) SoftEther Corporation (Tsukuba, Japan) [438.50 km]
18709) extride inc (Hitoyoshi, Japan) [520.25 km]
 6405) Allied Telesis Capital Corporation (Misawa, Japan) [841.68 km]
 6581) haza (Haebaru, Japan) [1203.42 km]
21118) GLBB Japan (Naha, Japan) [1204.47 km]

speedtest-cli --server <サーバーナンバー> で測定サーバーを指定できます。(名古屋のpoteitooo を指定してみます。)

# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (163.43.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [137.73 km]: 11.998 ms
Testing download speed................................................................................
Download: 80.47 Mbit/s
Testing upload speed................................................................................................
Upload: 105.94 Mbit/s

代表的な各社サービスの回線速度の比較

当方が現在利用中の4つのWebサーバーにて、測定サーバーを同一にして回線速度を測定・比較してみます。

さくらのVPSでの測定結果

CPU 3core/メモリ 2GBプランで測定

■測定1回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (160.16.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [137.73 km]: 9.635 ms
Testing download speed................................................................................
Download: 91.33 Mbit/s
Testing upload speed................................................................................................
Upload: 105.98 Mbit/s
■測定2回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (160.16.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [137.73 km]: 10.068 ms
Testing download speed................................................................................
Download: 89.52 Mbit/s
Testing upload speed................................................................................................
Upload: 103.34 Mbit/s
■測定3回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (160.16.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [137.73 km]: 9.248 ms
Testing download speed................................................................................
Download: 89.59 Mbit/s
Testing upload speed................................................................................................
Upload: 105.24 Mbit/s

さくらのクラウドでの測定結果

CPU 3core/メモリ 2GBプランで測定

■測定1回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (59.106.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [273.89 km]: 9.782 ms
Testing download speed................................................................................
Download: 117.43 Mbit/s
Testing upload speed................................................................................................
Upload: 97.29 Mbit/s
■測定2回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (59.106.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [273.89 km]: 10.964 ms
Testing download speed................................................................................
Download: 196.77 Mbit/s
Testing upload speed................................................................................................
Upload: 96.59 Mbit/s
■測定3回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from SAKURA Internet (59.106.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [273.89 km]: 11.654 ms
Testing download speed................................................................................
Download: 207.94 Mbit/s
Testing upload speed................................................................................................
Upload: 98.54 Mbit/s

ConoHaのVPSでの測定結果

CPU 3core/メモリ 2GBプランで測定

■測定1回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from GMO Internet,Inc (150.95.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [258.44 km]: 9.776 ms
Testing download speed................................................................................
Download: 123.72 Mbit/s
Testing upload speed................................................................................................
Upload: 135.17 Mbit/s
■測定2回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from GMO Internet,Inc (150.95.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [258.44 km]: 9.301 ms
Testing download speed................................................................................
Download: 123.56 Mbit/s
Testing upload speed................................................................................................
Upload: 134.60 Mbit/s
■測定3回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from GMO Internet,Inc (150.95.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [258.44 km]: 8.946 ms
Testing download speed................................................................................
Download: 124.73 Mbit/s
Testing upload speed................................................................................................
Upload: 136.67 Mbit/s

Amazon Lightsailでの測定結果

CPU 2core/メモリ 4GBプランで測定

■測定1回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from Amazon.com (52.199.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [263.99 km]: 16.886 ms
Testing download speed................................................................................
Download: 141.18 Mbit/s
Testing upload speed................................................................................................
Upload: 270.98 Mbit/s
■測定2回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from Amazon.com (52.199.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [263.99 km]: 18.877 ms
Testing download speed................................................................................
Download: 143.41 Mbit/s
Testing upload speed................................................................................................
Upload: 301.26 Mbit/s
■測定3回目
# speedtest-cli --server 19038
Retrieving speedtest.net configuration...
Testing from Amazon.com (52.199.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by poteitooo (Nagoya) [263.99 km]: 11.089 ms
Testing download speed................................................................................
Download: 136.20 Mbit/s
Testing upload speed................................................................................................
Upload: 342.05 Mbit/s

回線速度測定結果一覧表

※ping、ダウンロード、アップロード毎に一番パフォーマンスの悪かった数値は赤文字、一番パフォーマンスの良かった数値は青文字で表示しています。

サービス名pingダウンロードアップロード
さくらのVPS(測定1回目)9.635 ms91.33 Mbit/s105.98 Mbit/s
さくらのVPS(測定2回目)10.068 ms89.52 Mbit/s103.34 Mbit/s
さくらのVPS(測定3回目)9.248 ms89.59 Mbit/s105.24 Mbit/s
さくらのクラウド(測定1回目)9.782 ms117.43 Mbit/s97.29 Mbit/s
さくらのクラウド(測定2回目)10.964 ms196.77 Mbit/s96.59 Mbit/s
さくらのクラウド(測定3回目)11.654 ms207.94 Mbit/s98.54 Mbit/s
ConoHaのVPS(測定1回目)9.776 ms123.72 Mbit/s135.17 Mbit/s
ConoHaのVPS(測定2回目)9.301 ms123.56 Mbit/s134.60 Mbit/s
ConoHaのVPS(測定3回目)8.946 ms124.73 Mbit/s136.67 Mbit/s
Amazon Lightsail(測定1回目)16.886 ms141.18 Mbit/s270.98 Mbit/s
Amazon Lightsail(測定2回目)18.877 ms143.41 Mbit/s301.26 Mbit/s
Amazon Lightsail(測定3回目)11.089 ms136.20 Mbit/s342.05 Mbit/s

Webサーバ上で測定した回線速度のダウンロードとアップロードは、サイト閲覧者にとっては逆の扱いとなるので、サイト閲覧者のダウンロード速度が一番早いのは「Amazon Lightsail」という結果になりました。そのかわりpingの値が若干悪いです。

ConoHaのVPSは総合的に良いパフォーマンスを出しています。

まとめ

サーバーのCUI環境でのダウンロード速度(回線速度)の測定はspeedtest-cliで簡単にできる。

サーバー環境の速度なので、サーバのアップロード速度がサイト閲覧者にとってのダウンロード速度、ダウンロード速度がサイト閲覧者のアップロード速度となる。

さくらのVPS、さくらのクラウド、ConoHaのVPS、Amazon Lightsailで比較すると、サイト閲覧者のダウンロード速度はAmazon Lightsailが他のサービスよりも2倍~3倍速い。ConoHaのVPSは総合的に優等生。

以上です。

タイトルとURLをコピーしました