かべちゃんのウェブサイト
付録C:性能評価

付録C:性能評価

Wyvern 2.0/2.1/2.2 系の簡単な性能評価を行った結果について報告します。 Wyvern のコンパイルはデフォルトのままで何もオプションを指定していません。 ベンチマークツールには、Apache に附属の ab-1.3d を利用しました。

実験環境

マシンスペック

Wyvern が動作するマシンとベンチマークプログラムが動作するマシンのスペックは、 以下の通りです。

 Wyvern動作マシンBenchmark動作マシン
CPU:Cyrix GXm (300MHz)Intel Pentium III (600MHz)
OS:5.3-RELEASE-p54.11-RELEASE
Mem:128MB196MB
NIC:RealTek 8139 10/100BaseTXIntel 82559 Pro/100

ネットワーク距離

クライアントマシンからサーバマシンまでのネットワーク的な距離です。 ping(8)を利用して測定しました。


  kouichi@swordfish[715][1:23] ping -c 10 192.168.1.23
  PING 192.168.1.23 (192.168.1.23): 56 data bytes
  64 bytes from 192.168.1.23: icmp_seq=0 ttl=64 time=0.544 ms
  64 bytes from 192.168.1.23: icmp_seq=1 ttl=64 time=0.467 ms
  64 bytes from 192.168.1.23: icmp_seq=2 ttl=64 time=0.460 ms
  64 bytes from 192.168.1.23: icmp_seq=3 ttl=64 time=0.476 ms
  64 bytes from 192.168.1.23: icmp_seq=4 ttl=64 time=0.463 ms
  64 bytes from 192.168.1.23: icmp_seq=5 ttl=64 time=0.477 ms
  64 bytes from 192.168.1.23: icmp_seq=6 ttl=64 time=0.459 ms
  64 bytes from 192.168.1.23: icmp_seq=7 ttl=64 time=0.436 ms
  64 bytes from 192.168.1.23: icmp_seq=8 ttl=64 time=0.469 ms
  64 bytes from 192.168.1.23: icmp_seq=9 ttl=64 time=0.461 ms

  --- 192.168.1.23 ping statistics ---
  10 packets transmitted, 10 packets received, 0% packet loss
  round-trip min/avg/max/stddev = 0.436/0.471/0.544/0.027 ms

評価結果

クライアントマシンからサーバマシンに下記に示すコマンドを実行した結果を 性能評価結果として示します。 Thread/Request は、Wyvern の設定における最大スレッド数と最大リクエスト数です。 また、Wyvern 2.1.x と 2.2.x 系では Keep-Alive 接続の有無でも実験しました。 なお、最大リクエスト数が 48 より小さい場合では、 すべての場合で正確な計測ができませんでした。 実験時にはサーバの負荷が w(1) コマンドで調べて、 0.00 になったときに実行しています。


  % ab -c 100 -t 10 -k http://192.168.1.23/
  % ab -c 100 -t 10 http://192.168.1.23/

Wyvern性能評価(max-request=48)
Server Software Wyvern/2.0.8 Wyvern/2.1.2 Wyvern/2.2.0.20
Thread/Request 1/4824/4824/48
Keep-Alive 無し無し有り無し有り
Server Hostname 192.168.1.23 192.168.1.23192.168.1.23
Server Port 808080818082
Document Path /index.html /index.html/index.html
Document Length [bytes] 036,90736,907
Concurrency Level 100100100
Time taken for tests [sec] 10.00310.00210.00110.00110.004
Complete requests 258 363413 453553
Failed requests 250 132 011
Broken pipe errors 0 00 00
Keep-Alive requests 362 518
Total transferred [bytes] 9,456,113 13,449,02414,249,533 17,602,01320,590,526
HTML transferred [bytes] 9,376,957 13,362,99314,145,565 17,477,03920,425,770
Requests per second [#/sec] 25.79 36.2941.30 45.3055.28
Time per request [ms] 38.77 27.5524.22 22.0818.09
Transfer rate [Kbyte/sec] 945.33 1344.631424.81 1760.032058.23
Wyvern性能評価(max-request=64)
Server Software Wyvern/2.0.8 Wyvern/2.1.2 Wyvern/2.2.0.20
Thread/Request 1/6432/6432/64
Keep-Alive 無し無し有り無し有り
Server Hostname 192.168.1.23 192.168.1.23192.168.1.23
Server Port 808080818082
Document Path /index.html /index.html/index.html
Document Length [bytes] 36,90736,90736,907
Concurrency Level 100100100
Time taken for tests [sec] 10.00910.00110.00210.00410.003
Complete requests 250 362395 514539
Failed requests 0 014 00
Broken pipe errors 0 00 00
Keep-Alive requests 372 512
Total transferred [bytes] 9,441,268 13,473,60014,319,528 20,130,50620,705,488
HTML transferred [bytes] 9,362,112 13,387,56914,214,688 19,987,45420,539,665
Requests per second [#/sec] 24.98 36.2039.49 51.3853.88
Time per request [ms] 40.04 27.5525.32 19.4618.56
Transfer rate [Kbyte/sec] 943.28 1347.231431.67 2012.252069.93
Wyvern性能評価(max-request=96)
Server Software Wyvern/2.0.8 Wyvern/2.1.2 Wyvern/2.2.0.20
Thread/Request 1/9648/9648/96
Keep-Alive 無し無し有り無し有り
Server Hostname 192.168.1.23 192.168.1.23192.168.1.23
Server Port 808080818082
Document Path /index.html /index.html/index.html
Document Length [bytes] 36,90736,90736,907
Concurrency Level 100100100
Time taken for tests [sec] 10.00210.00110.00510.00410.001
Complete requests 247 361383 433535
Failed requests 0 01 00
Broken pipe errors 0 00 00
Keep-Alive requests 379 508
Total transferred [bytes] 9,359,404 13,446,12814,313,371 20,130,50620,553,715
HTML transferred [bytes] 9,281,172 13,360,33414,208,563 19,987,45420,389,389
Requests per second [#/sec] 24.70 36.1038.28 43.2853.49
Time per request [ms] 40.49 27.7026.12 23.1118.69
Transfer rate [Kbyte/sec] 935.75 1344.481430.76 1763.802055.17
Wyvern性能評価(max-request=128)
Server Software Wyvern/2.0.8 Wyvern/2.1.2 Wyvern/2.2.0.20
Thread/Request 1/12864/12864/128
Keep-Alive 無し無し有り無し有り
Server Hostname 192.168.1.23 192.168.1.23192.168.1.23
Server Port 808080818082
Document Path /index.html /index.html/index.html
Document Length [bytes] 36,90736,90736,907
Concurrency Level 100100100
Time taken for tests [sec] 10.00210.00410.00310.00210.002
Complete requests 247 359376 420535
Failed requests 0 00 00
Broken pipe errors 0 00 00
Keep-Alive requests 365 510
Total transferred [bytes] 9,333,628 13,367,46414,144,437 17,729,03920,385,145
HTML transferred [bytes] 9,255,396 13,282,14414,040,960 17,602,23120,221,909
Requests per second [#/sec] 24.70 35.8937.59 41.9953.49
Time per request [ms] 40.49 27.8726.60 23.8118.70
Transfer rate [Kbyte/sec] 933.18 1336.211414.02 1772.552038.11
Wyvern-2.2.0.20性能評価(max-request=64)
Thread 48 1632 6480
Keep-Alive 無し有り無し有り 無し有り無し有り 無し有り無し有り
Document Length [bytes] 36,907
Concurrency Level 100
Time taken for tests [sec] 10.00
Complete requests 475556 474559 458534 514539 484531 417536
Failed requests 0000 0000 0000
Broken pipe errors 0000 0000 0000
Keep-Alive requests 522 525 506 512 507 512
Total transferred [bytes] 17,754,62720,783,494 17,877,62621,006,062 17,528,87420,292,973 20,130,50620,705,488 20,089,77220,561,522 18,110,55320,525,782
HTML transferred [bytes] 17,629,12920,617,684 17,751,34220,838,453 17,404,68620,130,762 19,987,45420,539,665 19,946,19620,396,825 17,980,33920,361,632
Requests per second [#/sec] 47.4855.57 47.4055.88 45.8053.38 51.3853.88 48.4053.08 41.6953.59
Time per request [ms] 21.0618.00 21.1017.90 21.8418.73 19.4618.56 20.6618.84 23.9918.66
Transfer rate [Kbyte/sec] 1774.752077.10 1787.582099.77 1752.712028.69 2012.252069.93 2008.782055.54 1810.692052.37
Wyvern-2.2.0.20性能評価(max-thread=4)
Request 4048 6496 128
Keep-Alive 無し有り無し有り 無し有り無し有り 無し有り
Document Length [bytes] 36,907
Concurrency Level 100
Time taken for tests [sec] 10.00
Complete requests 563588 536572 475556 532537 471546
Failed requests 292503 0000 00
Broken pipe errors 0000 0000 00
Keep-Alive requests 528 533 522 503 512
Total transferred [bytes] 19,983,26221,049,690 20,024,83221,279,248 17,754,62720,783,494 19,906,56420,107,577 17,642,85820,442,560
HTML transferred [bytes] 19,842,30620,881,825 19,883,35221,109,595 17,629,12920,617,684 19,766,13219,947,395 17,518,40820,279,729
Requests per second [#/sec] 56.2958.78 53.5957.18 47.4855.57 53.1953.68 47.0954.59
Time per request [ms] 17.7717.01 18.6617.49 21.0618.00 18.8018.63 21.2418.32
Transfer rate [Kbyte/sec] 1997.932104.34 2002.282127.29 1774.752077.10 1990.262010.15 1763.932044.05

まとめ

2.2.x は、2.0.x および 2.1.x よりも格段にパフォーマンスが向上しており、 静的コンテンツの提供だけなら十分実用的なウェブサーバとして機能するでしょう。 また、最大スレッド数固定と最大リクエスト数固定で実験した結果から、 同時リクエスト数を100と想定した場合、wyvern.conf の設定としては、 <max-thread> 値が 4 あるいは 8 で <max-request> が 64 が最適値と考えられます。 ただし、静的コンテンツのみを提供する場合は、 最大スレッド数が 1 の方が効率的に働く場合があるようです。 これは、スレッドのコンテキスト切替が発生しない分だけ処理が速いのでしょう。 実際の調整は、マシンのスペックなどを考慮する必要があります。 本性能評価は、あくまでも参考程度と考えて下さい。