■
さてhttpd.conf をいじる
KeepAlive On
MaxKeepAliveRequests 30
KeepAliveTimeOut 1
1
Concurrency Level: 100
Time taken for tests: 46.054 seconds
Complete requests: 10000
Failed requests: 579
(Connect: 0, Receive: 0, Length: 579, Exceptions: 0)
Write errors: 0
Total transferred: 144288194 bytes
HTML transferred: 141508194 bytes
Requests per second: 217.14 [#/sec] (mean)
Time per request: 460.539 [ms] (mean)
Time per request: 4.605 [ms] (mean, across all concurrent requests)
Transfer rate: 3059.60 [Kbytes/sec] received
2
Concurrency Level: 100
Time taken for tests: 39.518 seconds
Complete requests: 10000
Failed requests: 906
(Connect: 0, Receive: 0, Length: 906, Exceptions: 0)
Write errors: 0
Total transferred: 144185516 bytes
HTML transferred: 141405516 bytes
Requests per second: 253.05 [#/sec] (mean)
Time per request: 395.176 [ms] (mean)
Time per request: 3.952 [ms] (mean, across all concurrent requests)
Transfer rate: 3563.12 [Kbytes/sec] received
かわらんね・・・
並列を500に
Concurrency Level: 500
Time taken for tests: 37.651 seconds
Complete requests: 10000
Failed requests: 1380
(Connect: 0, Receive: 0, Length: 1380, Exceptions: 0)
Write errors: 0
Total transferred: 144045142 bytes
HTML transferred: 141264864 bytes
Requests per second: 265.59 [#/sec] (mean)
Time per request: 1882.566 [ms] (mean)
Time per request: 3.765 [ms] (mean, across all concurrent requests)
Transfer rate: 3736.10 [Kbytes/sec] received
700
Concurrency Level: 700
Time taken for tests: 54.106 seconds
Complete requests: 10000
Failed requests: 895
(Connect: 0, Receive: 0, Length: 895, Exceptions: 0)
Write errors: 0
Total transferred: 144188970 bytes
HTML transferred: 141408970 bytes
Requests per second: 184.82 [#/sec] (mean)
Time per request: 3787.435 [ms] (mean)
Time per request: 5.411 [ms] (mean, across all concurrent requests)
Transfer rate: 2602.47 [Kbytes/sec] received
本陣を触る。
Mac clients 200 / thred per child 50 = 4 つのプロセスが出来るはず?
最初から4つ作っておいてみる。
<IfModule mpm_worker_module>
StartServers 4
MaxClients 200
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 50
MaxRequestsPerChild 0
</IfModule>
確かにそうなってる?
# ps aux|grep http
root 13520 0.0 0.1 109536 3712 pts/5 T 17:48 0:00 vim extra/httpd-mpm.conf
root 16093 0.0 0.2 132064 4516 ? Ss 18:00 0:00 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 16310 5.7 0.4 1389792 10068 ? S 18:00 0:02 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 16510 5.1 0.4 735916 9764 ? Sl 18:01 0:01 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 16567 5.2 0.4 735476 9256 ? Sl 18:01 0:01 /usr/local/httpd-2.2.16/bin/httpd -k start
root 16722 0.0 0.0 65392 844 pts/5 S+ 18:01 0:00 grep http
ぼちぼち。
Concurrency Level: 100
Time taken for tests: 37.485 seconds
Complete requests: 10000
Failed requests: 801
(Connect: 0, Receive: 0, Length: 801, Exceptions: 0)
Write errors: 0
Total transferred: 144218486 bytes
HTML transferred: 141438486 bytes
Requests per second: 266.78 [#/sec] (mean)
Time per request: 374.846 [ms] (mean)
Time per request: 3.748 [ms] (mean, across all concurrent requests)
Transfer rate: 3757.24 [Kbytes/sec] received
デフォルトと同じく6つプロセスが立つようにしてみる
<IfModule mpm_worker_module>
StartServers 4
MaxClients 300
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 50
MaxRequestsPerChild 0
</IfModule>
プロセスは最初4→2、で高負荷になると6に戻った。
# ps aux|grep http
root 13520 0.0 0.1 109536 3712 pts/5 T 17:48 0:00 vim extra/httpd-mpm.conf
root 17959 0.0 0.2 132064 4524 ? Ss 18:08 0:00 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 18749 2.0 0.4 800996 9460 ? Sl 18:10 0:02 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 18981 6.3 0.4 736028 9220 ? Sl 18:12 0:00 /usr/local/httpd-2.2.16/bin/httpd -k start
daemon 19038 5.5 0.3 800480 8196 ? Sl 18:12 0:00 /usr/local/httpd-2.2.16/bin/httpd -k start
root 19189 0.0 0.0 65392 840 pts/5 S+ 18:12 0:00 grep http
# cat /proc/17959/status
Name: httpd
State: S (sleeping)
SleepAVG: 78%
Tgid: 17959
Pid: 17959
PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 64
Groups: 0 1 2 3 4 6 10
VmPeak: 132064 kB
VmSize: 132064 kB
VmLck: 0 kB
VmHWM: 4524 kB
VmRSS: 4524 kB
VmData: 2432 kB
VmStk: 84 kB
VmExe: 412 kB
VmLib: 5632 kB
VmPTE: 312 kB
StaBrk: 03ac4000 kB
Brk: 03cde000 kB
StaStk: 7fff1d8446f0 kB
仮想メモリ的に132MBぐらい?なので10プロセスで1.3Gぐらいメモリを食うのか。
あんまりapacheにメモリは裂けないので、これぐらいで良しとする。