2010年1月20日水曜日

abコマンドによるApacheサーバーの測定

Apacheサーバーの読み込み速度の向上を目指す。

まずは測定から
1回目

[root@localhost ~]# ab -n 100 -c 10 http://xxxx-net.jp/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking xxxx-net.jp (be patient).....done


Server Software:        Apache
Server Hostname:        xxxx-net.jp
Server Port:            80

Document Path:          /
Document Length:        37584 bytes

Concurrency Level:      10
Time taken for tests:   28.921658 seconds
Complete requests:      100

Failed requests: 79   (Connect: 0, Length: 79, Exceptions: 0)
Write errors:           0
Total transferred:      826546 bytes
HTML transferred:       789264 bytes
Requests per second:    3.46 [#/sec] (mean)
Time per request:       2892.166 [ms] (mean)
Time per request:       289.217 [ms] (mean, across all concurrent requests)
Transfer rate:          27.90 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       51  887 2012.3     64    7519
Processing:   290 1933 2688.8   1083   15819
Waiting:      289 1864 2673.5   1063   15819
Total:        393 2821 3243.5   1224   15896

Percentage of the requests served within a certain time (ms)
  50%   1224
  66%   2863
  75%   3277
  80%   3749
  90%   7847
  95%  10987
  98%  15701
  99%  15896
 100%  15896 (longest request)
「Failed requests: 79」なんでだろう?

2回目
[root@localhost ~]# ab -n 100 -c 10 http://xxxx-net.jp/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking tachibana-net.jp (be patient).....done


Server Software:        Apache
Server Hostname:        xxxx-net.jp
Server Port:            80

Document Path:          /
Document Length:        0 bytes

Concurrency Level:      10
Time taken for tests:   22.197865 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      36400 bytes
HTML transferred:       0 bytes
Requests per second:    4.50 [#/sec] (mean)
Time per request:       2219.786 [ms] (mean)
Time per request:       221.979 [ms] (mean, across all concurrent requests)
Transfer rate:          1.58 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       52  513 1073.0     64    3177
Processing:   285 1652 2012.3    989   13347
Waiting:      285 1651 2012.3    989   13346
Total:        339 2165 2563.8   1283   16357

Percentage of the requests served within a certain time (ms)
  50%   1283
  66%   1750
  75%   2931
  80%   3542
  90%   4922
  95%   7382
  98%  11485
  99%  16357
 100%  16357 (longest request)

3回目
[root@localhost ~]# ab -n 100 -c 10 http://xxxx-net.jp/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking tachibana-net.jp (be patient).....done


Server Software:        Apache
Server Hostname:        xxxx-net.jp
Server Port:            80

Document Path:          /
Document Length:        0 bytes

Concurrency Level:      10
Time taken for tests:   29.39944 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      36400 bytes
HTML transferred:       0 bytes
Requests per second:    3.44 [#/sec] (mean)
Time per request:       2903.994 [ms] (mean)
Time per request:       290.399 [ms] (mean, across all concurrent requests)
Transfer rate:          1.21 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       52  954 2424.7     65    9165
Processing:   288 1633 2457.4    965   13319
Waiting:      288 1632 2457.3    963   13318
Total:        341 2587 3746.6   1221   21347

Percentage of the requests served within a certain time (ms)
  50%   1221
  66%   1653
  75%   2385
  80%   2710
  90%   8585
  95%  10120
  98%  20832
  99%  21347
 100%  21347 (longest request)


次回から
1.Apacheのキャッシュ機能を有効にした場合
2.PHPのアクセラレーターを使った場合
3.Xoopsモジュールのキャッシュを使用した場合

を調べてみることにします。どうなることやら・・・