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"

http_benchmark

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

eZ Publish 4.0.0rc1 was released today with a numerous bug fixes and code enhancements over the previous alpha2 release. Highlights include performance optimisations.

What have really been done to optimize the performance of eZ Publish? I have done a benchmark of eZ Publish 4 alpha2 vs eZ Publish 4 rc1 and PHP 5.1.2 vs PHP 5.2.5, here is the results:

Test environment

Hardware

IBM HS21
2x quad core
8GB Memory

Software

Suse Linux Enterprise Server 10 SP1 64bit
Apache 2.2.3
APC 3.0.15
MySQL 5.0.26

PHP 5.1.2 / PHP 5.2.5

The benchmark

ab2 -n 1000 -c 20 http://site.no/

The results

eZ Publish 4.0.0-alpha2 - PHP 5.1.2

Concurrency Level: 20
Time taken for tests: 11.157765 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 18968000 bytes
HTML transferred: 18534000 bytes
Requests per second: 89.62 [#/sec] (mean)
Time per request: 223.155 [ms] (mean)
Time per request: 11.158 [ms] (mean, across all concurrent requests)
Transfer rate: 1660.10 [Kbytes/sec] received

eZ Publish 4.0.0rc1 - PHP 5.1.2

Concurrency Level: 20
Time taken for tests: 9.19638 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 20958000 bytes
HTML transferred: 20524000 bytes
Requests per second: 110.87 [#/sec] (mean)
Time per request: 180.393 [ms] (mean)
Time per request: 9.020 [ms] (mean, across all concurrent requests)
Transfer rate: 2269.05 [Kbytes/sec] received

eZ Publish 4.0.0rc1 - PHP 5.2.5

Concurrency Level: 20
Time taken for tests: 27.289963 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 20958000 bytes
HTML transferred: 20524000 bytes
Requests per second: 36.64 [#/sec] (mean)
Time per request: 545.799 [ms] (mean)
Time per request: 27.290 [ms] (mean, across all concurrent requests)
Transfer rate: 749.95 [Kbytes/sec] received

eZ Publish 4.0.0alpha2 - PHP 5.2.5

Concurrency Level: 20
Time taken for tests: 28.472612 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 18968000 bytes
HTML transferred: 18534000 bytes
Requests per second: 35.12 [#/sec] (mean)
Time per request: 569.452 [ms] (mean)
Time per request: 28.473 [ms] (mean, across all concurrent requests)
Transfer rate: 650.55 [Kbytes/sec] received

I can't understand why PHP 5.1.2 is much faster then PHP 5.2.5? Is there something wrong with my environment?

UPDATE:

eZ Publish 4.0.0 - PHP 5.1.6

Concurrency Level: 20
Time taken for tests: 13.552577 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 21607000 bytes
HTML transferred: 21173000 bytes
Requests per second: 73.79 [#/sec] (mean)
Time per request: 271.052 [ms] (mean)
Time per request: 13.553 [ms] (mean, across all concurrent requests)
Transfer rate: 1556.90 [Kbytes/sec] received

eZ Publish 4.0.0 - PHP 5.2.0

Concurrency Level: 20
Time taken for tests: 13.168876 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 21671773 bytes
HTML transferred: 21236471 bytes
Requests per second: 75.94 [#/sec] (mean)
Time per request: 263.378 [ms] (mean)
Time per request: 13.169 [ms] (mean, across all concurrent requests)
Transfer rate: 1607.05 [Kbytes/sec] received

gdb httpd2-prefork

b ap_process_request

run -X -d /usr/sbin/httpd2-prefork

s