PHP Ninja をベンチマークしてみた

PHP Ninja をベンチマークしようと、βテストに参加してみたのですが、私のサイトは、リバースプロキシのキャッシュが消えないようで、WordPressにログインせずにサイトにアクセスすると、未だにインストーラのページにリダイレクトされるためアクセスできません。(^^;


https://twitter.com/#!/shinichiN/status/176887382816198656

ってことで、このサイトで ab でベンチマークさせてもらいました。

【注意】普通の VPS のサーバとかの WP だと同時接続 10 (ab -c 10) とかでもサーバが落ちてしまう可能性があります。他人のサーバだと DoS 攻撃になってしまう可能性があります。よい子のみなさんは真似しないでください。自分のサーバをベンチマークするときも小さな値から徐々に値を増やして慎重に行いましょう。

$ ab -c 1000 -n 10000 http://210.152.137.144/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 210.152.137.144 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        nginx
Server Hostname:        210.152.137.144
Server Port:            80

Document Path:          /
Document Length:        39037 bytes

Concurrency Level:      1000
Time taken for tests:   12.228 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      409740424 bytes
HTML transferred:       407376574 bytes
Requests per second:    817.82 [#/sec] (mean)
Time per request:       1222.761 [ms] (mean)
Time per request:       1.223 [ms] (mean, across all concurrent requests)
Transfer rate:          32724.06 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       23  180 291.1    125    4200
Processing:   107  824 608.3    616    6420
Waiting:       15  325 241.8    311    1815
Total:        234 1005 642.9    780    6452

Percentage of the requests served within a certain time (ms)
  50%    780
  66%    884
  75%   1023
  80%   1092
  90%   2012
  95%   2489
  98%   2720
  99%   3669
 100%   6452 (longest request)

Requests per second: 817.82 [#/sec] (mean)

Time per request: 1222.761 [ms] (mean)
100% 6452 (longest request)

自分のサイトでもやってみました

キャッシュの削除の仕方が悪かったのか、やっと削除できたようで、普通にサイトにアクセスできるようになりました。

WordPress 3.3.1 をインストールしただけの状態でのベンチマークです。

$ ab -c 1000 -n 10000 http://210.152.137.148/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 210.152.137.148 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        nginx
Server Hostname:        210.152.137.148
Server Port:            80

Document Path:          /
Document Length:        7669 bytes

Concurrency Level:      1000
Time taken for tests:   3.782 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      80396353 bytes
HTML transferred:       78104053 bytes
Requests per second:    2644.38 [#/sec] (mean)
Time per request:       378.160 [ms] (mean)
Time per request:       0.378 [ms] (mean, across all concurrent requests)
Transfer rate:          20761.60 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       22   73  45.1     55     209
Processing:    46  151  69.5    135    1703
Waiting:       24  106  64.0    100     265
Total:         71  224  89.8    221    1777

Percentage of the requests served within a certain time (ms)
  50%    221
  66%    265
  75%    292
  80%    305
  90%    338
  95%    402
  98%    410
  99%    413
 100%   1777 (longest request)

Requests per second: 2644.38 [#/sec] (mean)

Time per request: 378.160 [ms] (mean)
100% 1777 (longest request)