2009年4月21日火曜日

後始末

このエントリーをブックマークに追加 このエントリーを含むはてなブックマーク
方針が決まったのであとはただ作業。

普通に考えて、プロセス間通信でもしない限りmemory上のキャッシュはプロセス単位で閉じたものになる。ここにもこう書いてある。

each process builds up its own in-memory cache.

httplibで304と200が混じったのは、cacheに中身が入ったapache instanceに処理してもらえたかどうかなのだろう。

mpm.conf of /etc/httpd/conf.d
TheardLimitを1000にするのは怖くてできない。fileがそこまでたくさん作れる保証が無い。kernelの.configをいじればいいのだろうけど。

<IfModule worker.c>
StartServers 1
MinSpareThreads 16
MaxSpareThreads 32
MaxRequestsPerChild 0
ThreadLimit 512
ThreadsPerChild 512
MaxClients 512
</IfModule>


結果。
測定中にロードグラフを眺めると、CPU負荷はほとんど上がらずにNetworkのsentだけが100%の状態になる。

20%くらい改善したかな?

-c 300なら大丈夫。

[nori@asama]~/Desktop/work/srvtest% ab -n 100000 -c 300 "http://image.backgammonbase.com/image?gnubgid=4HPwATDgc%2FABMA%3AMAAAAAAAAAAA&height=300&width=400&css=minimal&format=png"
This is ApacheBench, Version 2.0.40-dev <$Revision: 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 image.backgammonbase.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Finished 100000 requests


Server Software: Apache/2.2.3
Server Hostname: image.backgammonbase.com
Server Port: 80

Document Path: /image?gnubgid=4HPwATDgc%2FABMA%3AMAAAAAAAAAAA&height=300&width=400&css=minimal&format=png
Document Length: 17877 bytes

Concurrency Level: 300
Time taken for tests: 158.133125 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 1828222590 bytes
HTML transferred: 1789024272 bytes
Requests per second: 632.38 [#/sec] (mean)
Time per request: 474.399 [ms] (mean)
Time per request: 1.581 [ms] (mean, across all concurrent requests)
Transfer rate: 11290.32 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 94 84.1 93 3106
Processing: 113 378 18.2 379 1060
Waiting: 2 93 10.4 95 405
Total: 120 473 86.5 473 3956

Percentage of the requests served within a certain time (ms)
50% 473
66% 474
75% 474
80% 474
90% 474
95% 474
98% 474
99% 475
100% 3956 (longest request)

350にすると破綻の兆しでてくる。とはいえ、変更前の312よりはマシ。

[nori@asama]~/Desktop/work/srvtest% ab -n 100000 -c 350 "http://image.backgammonbase.com/image?gnubgid=4HPwATDgc%2FABMA%3AMAAAAAAAAAAA&height=300&width=400&css=minimal&format=png"
This is ApacheBench, Version 2.0.40-dev <$Revision: 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 image.backgammonbase.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Finished 100000 requests


Server Software: Apache/2.2.3
Server Hostname: image.backgammonbase.com
Server Port: 80

Document Path: /image?gnubgid=4HPwATDgc%2FABMA%3AMAAAAAAAAAAA&height=300&width=400&css=minimal&format=png
Document Length: 17877 bytes

Concurrency Level: 350
Time taken for tests: 158.20219 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 1827205440 bytes
HTML transferred: 1788094492 bytes
Requests per second: 632.83 [#/sec] (mean)
Time per request: 553.071 [ms] (mean)
Time per request: 1.580 [ms] (mean, across all concurrent requests)
Transfer rate: 11292.10 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 4 119 245.5 102 9104
Processing: 121 426 78.2 410 1831
Waiting: 2 103 26.2 102 719
Total: 128 545 262.3 512 10024

Percentage of the requests served within a certain time (ms)
50% 512
66% 513
75% 514
80% 514
90% 516
95% 716
98% 821
99% 1025
100% 10024 (longest request)

0 件のコメント: