以前から当社ホームページはWordPressで運用していますが、HTTPサーバーをApacheからNginxに乗り換えました。Nginxの前にリバースプロキシのVarnish、後ろにFastCGIマネージャのPHP-FPMを置いています。
(HTTPリクエスト) -> Varnish -> Nginx -> PHP-FPM
Ubuntu12.04にapt-getでインストールし、チューニングしない状態でApache Benchでベンチマークをとってみました。チューニングしない状態ではApache2単独の場合と大差ありませんでした。サーバーはKDDIのCloudCore VPS 2048です。
チューニングの方法についてはあらためて取り上げます。
1 |
ab -c 10 -t 60 http://www.atage.jp/ |
(1) Varnish + Nginx + PHP-FPMの結果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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.atage.jp (be patient) Finished 157 requests Server Software: nginx/1.1.19 Server Hostname: www.atage.jp Server Port: 80 Document Path: / Document Length: 16583 bytes Concurrency Level: 10 Time taken for tests: 60.580 seconds Complete requests: 157 Failed requests: 0 Write errors: 0 Total transferred: 2684341 bytes HTML transferred: 2603531 bytes Requests per second: 2.59 [#/sec] (mean) Time per request: 3858.590 [ms] (mean) Time per request: 385.859 [ms] (mean, across all concurrent requests) Transfer rate: 43.27 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 4 51 206.5 6 1005 Processing: 2858 3664 239.5 3653 5211 Waiting: 2848 3654 243.4 3646 5205 Total: 2864 3714 365.0 3659 6216 Percentage of the requests served within a certain time (ms) 50% 3659 66% 3688 75% 3719 80% 3882 90% 3935 95% 4135 98% 4897 99% 5125 100% 6216 (longest request) |
(2) Apache2の結果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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.atage.jp (be patient) Finished 159 requests Server Software: Apache/2.2.22 Server Hostname: www.atage.jp Server Port: 80 Document Path: / Document Length: 16583 bytes Concurrency Level: 10 Time taken for tests: 60.248 seconds Complete requests: 159 Failed requests: 0 Write errors: 0 Total transferred: 2718337 bytes HTML transferred: 2645537 bytes Requests per second: 2.64 [#/sec] (mean) Time per request: 3789.189 [ms] (mean) Time per request: 378.919 [ms] (mean, across all concurrent requests) Transfer rate: 44.06 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 4 25 136.2 6 1004 Processing: 3339 3664 208.4 3608 4390 Waiting: 2529 2766 195.7 2721 3582 Total: 3346 3688 254.3 3614 4835 Percentage of the requests served within a certain time (ms) 50% 3614 66% 3656 75% 3689 80% 3735 90% 4032 95% 4349 98% 4395 99% 4691 100% 4835 (longest request) |