abを使ってみた

「DBにOracle使っているにも関わらずDBコネクションプーリングをしていないシステムがどれくらいもっさりなのか」を調べるため、自前でPerl & ithreadの負荷ツールを作っていたんだけど、こっちこそもっさりしていてどうもすみません、という感じなのでabを使ってみた。

POSTで投げる場合は、-p で http request body が書かれているファイル(自分で書く)を指定すればよろし。

$ ab -n 1000 -c 100 -p postfile -T 'application/x-www-form-urlencoded' http://target.lan/cgi-bin/devel/web/targetapp
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 cent2.lan (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        Apache/2.2.3
Server Hostname:        target.lan
Server Port:            80

Document Path:          /cgi-bin/devel/web/targetapp
Document Length:        97 bytes

Concurrency Level:      100
Time taken for tests:   224.671841 seconds
Complete requests:      1000
Failed requests:        13
   (Connect: 0, Length: 13, Exceptions: 0)
Write errors:           0
Non-2xx responses:      14
Total transferred:      270599 bytes
Total POSTed:           326326
HTML transferred:       104377 bytes
Requests per second:    4.45 [#/sec] (mean)
Time per request:       22467.184 [ms] (mean)
Time per request:       224.672 [ms] (mean, across all concurrent requests)
Transfer rate:          1.18 [Kbytes/sec] received
                        1.42 kb/s sent
                        2.59 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   13  39.0      1     437
Processing:   553 17740 24921.0   9892  201808
Waiting:      551 17385 24686.6   9878  201540
Total:        553 17753 24920.0   9966  201809

Percentage of the requests served within a certain time (ms)
  50%   9966
  66%  13296
  75%  19980
  80%  25274
  90%  38302
  95%  63747
  98%  101228
  99%  136885
 100%  201809 (longest request)

期待通りのもっさりさん。それにしても ab すげえ。C で書いてんのかな?