WordPressを2.5倍速くするPHPアクセラレータ「APC」とにかく速いWordPress(2)(3/4 ページ)

» 2016年01月25日 05時00分 公開
[中村けん牛プライム・ストラテジー]

ページのロード時間を計測する

 ページのロード時間を計測しましょう。ここで、Firefoxのアドオンである「Firebug」のネットタブや他のブラウザの開発ツールなどを起動させた状態でリロードするとロード時間が計れます。筆者の環境ではおよそ176msとなりました。



photo WordPressのトップページのロード時間をFirebugで確認したところ

 ターミナルに戻り、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秒当たりの同時リクエスト数がほぼ反比例し、相関関係にあることが分かります。

Copyright © ITmedia, Inc. All Rights Reserved.

RSSについて

アイティメディアIDについて

メールマガジン登録

@ITのメールマガジンは、 もちろん、すべて無料です。ぜひメールマガジンをご購読ください。