Perl日記

PerlとかRubyとかPHPとかPythonとか

Apache+Starman+Amon2とApache単体の静的ファイル出力ベンチマーク

メモ。
環境は最後に。

Apache+Starman+Amon2

$ starman --disable-keepalive app/app.psgi
$ ab -c 100 -n 1000 http://127.0.0.1/app/static/img/ttt/1/sss/thum.jpg
…
Document Path:          /app/static/img/ttt/1/sss/thum.jpg
Document Length:        120369 bytes

Concurrency Level:      100
Time taken for tests:   0.276 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      120621831 bytes
HTML transferred:       120450660 bytes
Requests per second:    3618.52 [#/sec] (mean)
Time per request:       27.636 [ms] (mean)
Time per request:       0.276 [ms] (mean, across all concurrent requests)
Transfer rate:          426242.81 [Kbytes/sec] received
…

Apache単体

$ ab -c 100 -n 1000 http://127.0.0.1/img/ttt/1/sss/thum.jpg
…
Document Path:          /img/ttt/1/sss/thum.jpg
Document Length:        120369 bytes

Concurrency Level:      100
Time taken for tests:   0.114 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      120701000 bytes
HTML transferred:       120369000 bytes
Requests per second:    8807.31 [#/sec] (mean)
Time per request:       11.354 [ms] (mean)
Time per request:       0.114 [ms] (mean, across all concurrent requests)
Transfer rate:          1038136.29 [Kbytes/sec] received
…

Apache+Starman+Amon2 Apache
1秒あたり捌くリクエスト数 3618.52 8807.31
1リクエストあたりの時間 0.276 ms 0.114 ms
Apache単体優位割合 約243%

まとめ

静的ファイルが極端に多い場合、Webサーバに任せよう。(そりゃそうか)
#その場合Keep-Aliveを切るのは逆にマイナスなのかな?



環境