Apache + lighttpd + fastcgiにしてみる

ちょっとお試し。

設定


$HTTP["url"] =~ "^/masudaitter/" {
server.port = 3000
#url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => ".html" )
server.indexfiles = ( "index.html", "dispatch.fcgi" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/opt/projects/masudaitter/public"
alias.url = ( "/masudaitter/" => "/opt/projects/masudaitter/public/" )

fastcgi.server = ( ".fcgi" =>
( "localhost" =>
(
"min-procs" => 1,
"max-procs" => 1,
"socket" => "/tmp/application.fcgi.socket",
"bin-path" => "/opt/projects/masudaitter/public/dispatch.fcgi",
"bin-environment" =>
(
"RAILS_ROOT" => "/opt/projects/masudaitter",
"RAILS_ENV" => "production"
)
)
)
)
}

ベンチマーク


~$ ab2 -n 100 http://storehouse.quickvps.net/masudaitter/
This is ApacheBench, Version 2.0.40-dev <: 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 storehouse.quickvps.net (be patient).....done


Server Software: lighttpd/1.4.13
Server Hostname: storehouse.quickvps.net
Server Port: 80

Document Path: /masudaitter/
Document Length: 34913 bytes

Concurrency Level: 1
Time taken for tests: 52.796000 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 3527300 bytes
HTML transferred: 3491300 bytes
Requests per second: 1.89 [#/sec] (mean)
Time per request: 527.960 [ms] (mean)
Time per request: 527.960 [ms] (mean, across all concurrent requests)
Transfer rate: 65.23 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 9 11 2.5 11 30
Processing: 428 516 112.0 496 1121
Waiting: 344 428 112.0 405 1038
Total: 438 527 112.4 506 1132

Percentage of the requests served within a certain time (ms)
50% 506
66% 518
75% 538
80% 551
90% 648
95% 799
98% 919
99% 1132
100% 1132 (longest request)

所感

ん〜、クライアント環境の差も結構ありそうだなぁ…。