abコマンドでリバースプロキシーを検証2

superweibu.com{nginx(リバースプロキシー)+nginx+php-fpm}とsuperweibu.mydns.jp{nginx+php-fpm}でabコマンドで検証してみました。phpのバージョンは5.5でOPcacheが有効になってます。

mydns.jpは記事をほとんどかいてません。プラグインもほとんど有効になっておらずwordpress単体ではこちらの方が軽いでしょう。

$ ab -n 1000 -c 10 http://www.superweibu.mydns.jp/
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 www.superweibu.mydns.jp (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        nginx/1.6.0
Server Hostname:        www.superweibu.mydns.jp
Server Port:            80

Document Path:          /
Document Length:        7776 bytes

Concurrency Level:      10
Time taken for tests:   19.985 seconds
Complete requests:      1000
Failed requests:        871
(Connect: 0, Receive: 0, Length: 871, Exceptions: 0)
Write errors:           0
Total transferred:      8015928 bytes
HTML transferred:       7775928 bytes
Requests per second:    50.04 [#/sec] (mean)
Time per request:       199.851 [ms] (mean)
Time per request:       19.985 [ms] (mean, across all concurrent requests)
Transfer rate:          391.69 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       16   27   7.6     26      54
Processing:    96  172  35.6    169     304
Waiting:       91  167  35.6    164     300
Total:        115  199  39.1    194     349

Percentage of the requests served within a certain time (ms)
50%    194
66%    213
75%    224
80%    232
90%    252
95%    269
98%    293
99%    311
100%    349 (longest request)
$ ab -n 1000 -c 10 //www.superweibu.com/
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 www.superweibu.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        nginx/1.6.0
Server Hostname:        www.superweibu.com
Server Port:            80

Document Path:          /
Document Length:        9654 bytes

Concurrency Level:      10
Time taken for tests:   12.450 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      9954000 bytes
HTML transferred:       9654000 bytes
Requests per second:    80.32 [#/sec] (mean)
Time per request:       124.504 [ms] (mean)
Time per request:       12.450 [ms] (mean, across all concurrent requests)
Transfer rate:          780.75 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       20   61  12.4     61     103
Processing:    25   62  13.1     63     139
Waiting:       18   56  13.1     56     129
Total:         44  124   9.6    123     196

Percentage of the requests served within a certain time (ms)
50%    123
66%    125
75%    126
80%    128
90%    133
95%    137
98%    144
99%    150
100%    196 (longest request)

結果、nginx+ php-fpmはFailed requests: 871としょりしきれていないですね。php-fpmのほうなんかな?こっちカスタマイズすればどうにかなりそうな気がするけど・・・。

こんなんじゃ土俵にたてないよね。

いずれにせよリバースプロキシーを有効化することによっての恩恵がでかいですね。サーバーの負荷に悩まされてる方?サイトの高速化を狙ってる方は意味があるんじゃないでしょうか?

おまけ、

Failed requests(リクエストの成否)
リクエストの失敗が発生しているようならWebサーバの処理が追い付いていない。特にプログラムを実行してページを生成する場合に起こりやすく、同時接続数の限界を超えていると考える。

だそうです。