その分、毎秒のリクエスト処理件数も増えているのだと考えられるが、念のため、httperfで固定レートでリクエスト負荷を加えた場合のCPU使用率を比較した。
結果的には、両者のCPU使用率の差は些少だった。
負荷をかけている期間(約100秒)中のCPU使用率の平均は以下の通り。
event MPM | worker MPM | |
%user | 13.23 | 13.09 |
%nice | 0.00 | 0.00 |
%system | 19.10 | 18.91 |
%iowait | 0.09 | 0.09 |
%steal | 0.00 | 0.00 |
%idle | 67.59 | 67.92 |
基本的にリクエスト処理によるCPU負荷は event MPM と worker MPM では大差はない。
event MPM の処理効率が上がっているため、abによる性能検証で、リクエスト処理件数が上がり、処理件数が増えた分、CPU使用率が増大した、ということでよいだろう。
以下 httperfコマンド実行結果をコピペし、投稿末尾に、CPU使用率のグラフをつけた。
特に深い考えはないが、いずれもhttperf は2プロセスで実行した。
(1) event MPM
(1.1) httperf #1
$ ./httperf --server centos5 --port 8080 --uri /hello.html --num-conns 200000 --rate 2000 httperf --client=0/1 --server=centos5 --port=8080 --uri=/hello.html --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=200000 --num-calls=1 httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE Maximum connect burst length: 3 Total: connections 200000 requests 200000 replies 200000 test-duration 99.993 s Connection rate: 2000.1 conn/s (0.5 ms/conn, <=10 concurrent connections) Connection time [ms]: min 0.4 avg 0.7 max 4.8 median 0.5 stddev 0.1 Connection time [ms]: connect 0.2 Connection length [replies/conn]: 1.000 Request rate: 2000.1 req/s (0.5 ms/req) Request size [B]: 71.0 Reply rate [replies/s]: min 1999.9 avg 2000.1 max 2000.1 stddev 0.1 (19 samples) Reply time [ms]: response 0.4 transfer 0.0 Reply size [B]: header 224.0 content 31.0 footer 0.0 (total 255.0) Reply status: 1xx=0 2xx=200000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 23.85 system 76.08 (user 23.8% system 76.1% total 99.9%) Net I/O: 636.8 KB/s (5.2*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
(1.2) httperf #2
# ./httperf --server centos5 --port 8080 --uri /hello.html --num-conns 200000 --rate 2000 httperf --client=0/1 --server=centos5 --port=8080 --uri=/hello.html --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=200000 --num-calls=1 httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE Maximum connect burst length: 4 Total: connections 200000 requests 200000 replies 200000 test-duration 99.993 s Connection rate: 2000.1 conn/s (0.5 ms/conn, <=10 concurrent connections) Connection time [ms]: min 0.1 avg 0.7 max 4.8 median 0.5 stddev 0.1 Connection time [ms]: connect 0.3 Connection length [replies/conn]: 1.000 Request rate: 2000.1 req/s (0.5 ms/req) Request size [B]: 71.0 Reply rate [replies/s]: min 1999.9 avg 2000.1 max 2000.1 stddev 0.1 (19 samples) Reply time [ms]: response 0.4 transfer 0.0 Reply size [B]: header 224.0 content 31.0 footer 0.0 (total 255.0) Reply status: 1xx=0 2xx=200000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 21.87 system 78.04 (user 21.9% system 78.0% total 99.9%) Net I/O: 636.8 KB/s (5.2*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
(2) worker MPM
(2.1) httperf #1
$ ./httperf --server centos5 --port 8080 --uri /hello.html --num-conns 200000 --rate 2000 httperf --client=0/1 --server=centos5 --port=8080 --uri=/hello.html --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=200000 --num-calls=1 httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE Maximum connect burst length: 3 Total: connections 200000 requests 200000 replies 200000 test-duration 99.993 s Connection rate: 2000.1 conn/s (0.5 ms/conn, <=10 concurrent connections) Connection time [ms]: min 0.4 avg 0.7 max 4.7 median 0.5 stddev 0.1 Connection time [ms]: connect 0.3 Connection length [replies/conn]: 1.000 Request rate: 2000.1 req/s (0.5 ms/req) Request size [B]: 71.0 Reply rate [replies/s]: min 1999.9 avg 2000.1 max 2000.1 stddev 0.1 (19 samples) Reply time [ms]: response 0.4 transfer 0.0 Reply size [B]: header 224.0 content 31.0 footer 0.0 (total 255.0) Reply status: 1xx=0 2xx=200000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 23.74 system 76.18 (user 23.7% system 76.2% total 99.9%) Net I/O: 636.8 KB/s (5.2*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
(2.2) httperf #2
# ./httperf --server centos5 --port 8080 --uri /hello.html --num-conns 200000 --rate 2000 httperf --client=0/1 --server=centos5 --port=8080 --uri=/hello.html --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=200000 --num-calls=1 httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE Maximum connect burst length: 4 Total: connections 200000 requests 200000 replies 200000 test-duration 99.993 s Connection rate: 2000.1 conn/s (0.5 ms/conn, <=10 concurrent connections) Connection time [ms]: min 0.2 avg 0.7 max 4.8 median 0.5 stddev 0.1 Connection time [ms]: connect 0.3 Connection length [replies/conn]: 1.000 Request rate: 2000.1 req/s (0.5 ms/req) Request size [B]: 71.0 Reply rate [replies/s]: min 1999.9 avg 2000.1 max 2000.1 stddev 0.1 (19 samples) Reply time [ms]: response 0.4 transfer 0.0 Reply size [B]: header 224.0 content 31.0 footer 0.0 (total 255.0) Reply status: 1xx=0 2xx=200000 3xx=0 4xx=0 5xx=0 CPU time [s]: user 22.19 system 77.72 (user 22.2% system 77.7% total 99.9%) Net I/O: 636.8 KB/s (5.2*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
0 件のコメント:
コメントを投稿