Home / Blog

ab

ab is a tool for benchmarking your Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.

Gnuplot

Gnuplot is a free, command-driven, interactive, function and data plotting program.

Benchmark

We run ab2 against my site, http://lotto-kim.net with 1000 requests and 100 concurrent connections and store the request time with -g.

kim@lotta:~> ab2 -g http_benchmark.txt -n 1000 -c 100 http://lotto-kim.net/
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 interira.no.ezpublish10.ezdeal.no (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:        lotto-kim.net
Server Port:            80

Document Path:          /
Document Length:        11313 bytes

Concurrency Level:      100
Time taken for tests:   27.395710 seconds
Complete requests:      1000
Failed requests:        9
   (Connect: 0, Length: 9, Exceptions: 0)
Write errors:           0
Total transferred:      11725880 bytes
HTML transferred:       11271195 bytes
Requests per second:    36.50 [#/sec] (mean)
Time per request:       2739.571 [ms] (mean)
Time per request:       27.396 [ms] (mean, across all concurrent requests)
Transfer rate:          417.99 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   62 152.5      0    1047
Processing:   228 2652 859.6   2751    6719
Waiting:      191 1966 764.0   2006    5679
Total:        229 2715 851.5   2780    6719

Percentage of the requests served within a certain time (ms)
  50%   2780
  66%   3030
  75%   3210
  80%   3312
  90%   3697
  95%   4023
  98%   4318
  99%   4660
 100%   6719 (longest request)

Results

kim@lotta:~> gnuplot
set terminal png
set output "http_benchmark.png"
set xlabel "request"
set ylabel "ms"
plot "http_benchmark.txt" using 7 with lines title "ctime", \
 "http_benchmark.txt" using 8 with lines title "dtime", \
 "http_benchmark.txt" using 9 with lines title "ttime", \
"http_benchmark.txt" using 10 with lines title "wait"

Here is the result of the benchmark plotted into a graph.

my blog

Mon Tue Wed Thu Fri Sat Sun
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31