2009/06/05(Fri) [長年日記]
[link] サムシング・フォー
ゆるゆるフェミニンより。結婚式のときに、新婦が身につけてると、幸せになるらしい4つのもの。メモメモ。
- サムシング ブルー(何か青いもの)
- サムシング ニュー(何か新しいもの)
- サムシング オールド(何か古いもの)
- サムシング ボロー(何か借り物)
[gas] 15.5Km/L
金曜に給油するのが習慣になってきた。最近、アクセルワークが雑で、エンジンマウントの類に悪いかな、と思ったり。
[server] Apache vs Lighttpd
どちらも使っていながら、ベンチマークしたことなかったので。使ったのは、この日記と、ab。
まず、Lighttpd-1.4.19のCGI。
% ab -n 5000 http://diary.mini13i.gotdns.org/index.rb
Concurrency Level: 1
Time taken for tests: 2141.272808 seconds
Requests per second: 2.34 [#/sec] (mean)
Time per request: 428.255 [ms] (mean)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 84.8 0 2999
Processing: 407 425 171.8 412 4016
Waiting: 398 415 171.2 403 3994
Total: 407 427 197.3 412 4016
次に、Apache-2.2.11のFastCGI。
% ab -n 5000 http://diary.mini13i.gotdns.org:8080/index.fcgi
Concurrency Level: 1
Time taken for tests: 4242.516145 seconds
Requests per second: 1.18 [#/sec] (mean)
Time per request: 848.503 [ms] (mean)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 42.4 0 2997
Processing: 216 847 400.1 827 5405
Waiting: 214 845 400.1 825 5403
Total: 216 847 403.0 827 5405
あれ、Apacheは、FastCGI使ってるにもかかわらず、Lighttpdの2倍かかってるよ? ならば、同時接続数5にしてやってみる。
まず、Lighttpd。
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.5 0 3
Processing: 412 656 331.2 715 1024
Waiting: 403 644 326.9 704 1005
Total: 412 656 332.0 716 1024
次に、Apache。
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.5 0 3
Processing: 1492 1633 314.3 1494 2196
Waiting: 1490 1632 314.5 1493 2195
Total: 1492 1634 313.9 1495 2196
あれー??? やっぱり、Lighttpdの方がいいなぁ。なら、Apacheも、CGIで比較。
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 417 590 268.1 543 1029
Waiting: 408 578 262.8 534 1007
Total: 417 590 268.1 543 1029
おお、ApacheのCGIが一番か。なら、FastCGIの優位性はどこに? Lighttpdは、tDiary-2.3.2だと、FastCGIにできなかったので、それも微妙な感じ。
なら、今度は、php(+xcache)で、どちらもFastCGI。使うのは、pukiwiki。
まず、Lighttpd。
% ab -n 5000 -c 5 "http://linux.mini13i.gotdns.org/?MySQL%2F%BA%C7%C5%AC%B2%BD%2F%A5%B5%A1%BC%A5%D0%A5%D1%A5%E9%A5%E1%A5%BF"
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 73.4 0 2999
Processing: 64 223 145.6 218 3262
Waiting: 61 210 139.4 206 3251
Total: 64 225 162.9 218 3262
次に、Apache。
% ab -n 5000 -c 5 "http://linux.mini13i.gotdns.org:8080/?MySQL%2F%BA%C7%C5%AC%B2%BD%2F%A5%B5%A1%BC%A5%D0%A5%D1%A5%E9%A5%E1%A5%BF" Benchmarking linux.mini13i.gotdns.org (be patient) Completed 500 requests Completed 1000 requests apr_poll: The timeout specified has expired (70007) Total of 1002 requests completed
は??? 設定が悪いのかな。
% less /etc/apache2/mods-available/fcgid.conf
:
MaxProcessCount 4
DefaultMaxClassProcessCount 2
この辺か。
MaxProcessCount 10 DefaultMaxClassProcessCount 5
適当に変更。ちなみに、Lighttpdは、8個のサブプロセスを動かしてる
Completed 500 requests Completed 1000 requests Completed 1500 requests apr_poll: The timeout specified has expired (70007) Total of 1506 requests completed
だめか。apacheがこれくらいで終わるわけないと思うので、どこか悪いに違いない。
[ツッコミを入れる]


