ページのロード時間を計測しましょう。ここで、Firefoxのアドオンである「Firebug」のネットタブや他のブラウザの開発ツールなどを起動させた状態でリロードするとロード時間が計れます。筆者の環境ではおよそ176msとなりました。
ターミナルに戻り、abコマンドでベンチマークを取ってみます。以下に、トップページに対して「同時10接続、100リクエスト」のベンチマークを取る例を示します。
[root@ip www]# ab -n 100 -c 10 http://ec2-xxx.xxx.compute.amazonaws.com/
次のような結果が返ってきます。
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking ec2-xxx.xxx.compute.amazonaws.com (be patient).....done
Server Software: Apache/2.4.6
Server Hostname: ec2-xxx.xxx.compute.amazonaws.com
Server Port: 80
Document Path: /
Document Length: 11373 bytes
Concurrency Level: 10
Time taken for tests: 8.894 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1166200 bytes
HTML transferred: 1137300 bytes
Requests per second: 11.24 [#/sec] (mean)
Time per request: 889.361 [ms] (mean)
Time per request: 88.936 [ms] (mean, across all concurrent requests)
Transfer rate: 128.05 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 0
Processing: 449 876 70.2 879 1004
Waiting: 437 842 67.2 849 974
Total: 449 876 70.2 879 1004
Percentage of the requests served within a certain time (ms)
50% 879
66% 909
75% 920
80% 930
90% 951
95% 976
98% 991
99% 1004
100% 1004 (longest request)
「Requests per second」が1秒当たりの同時リクエスト数です。筆者の環境では、11.24になりました。
このインスタンスは2vCPUですから、1000msを176msで割って2倍すると約11.36となり、上記の11.24と近似値です。ページのロード時間と1秒当たりの同時リクエスト数がほぼ反比例し、相関関係にあることが分かります。
WordPress自体のチューニングが必要な理由と高速化の基本的な考え方
ここが変わったCentOS 7──「新機能の概要とインストール」編
安いホスティングに引っ越しって簡単にいうけど 〜リモートアクセスにはSSHを使いましょう〜
Webのバグを燃やしまくるFirebugと、そのアドオン7選
httpd.confによるWebサーバの最適化
Apacheパフォーマンス・チューニングのポイント
Apacheパフォーマンス・チューニングの実践
MySQLの高度な管理とチューニングテクニック
安全を考えてPHPの実行時設定を調整するCopyright © ITmedia, Inc. All Rights Reserved.