Saturday, April 21, 2007

ab - Apache HTTP server benchmarking tool

ab is a tool for benchmarking your Apache 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.

Usage: ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-p postfile File containing data to POST
-T content-type Content-type header for POSTing
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234. (repeatable)
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-h Display usage information (this message)

Example:
ab -c 5 -n 200 http://www.test.com/

Results:
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 www.test.com (be patient)
Completed 100 requests
Finished 200 requests


Server Software: Apache/2.2.3
Server Hostname: www.test.com
Server Port: 80

Document Path: /
Document Length: 10087 bytes

Concurrency Level: 5
Time taken for tests: 65.31250 seconds
Complete requests: 200
Failed requests: 155
(Connect: 0, Length: 155, Exceptions: 0)
Write errors: 0
Non-2xx responses: 200
Total transferred: 2102126 bytes
HTML transferred: 2017726 bytes
Requests per second: 3.08 [#/sec] (mean)
Time per request: 1625.781 [ms] (mean)
Time per request: 325.156 [ms] (mean, across all concurrent requests)
Transfer rate: 31.55 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.4 0 15
Processing: 687 1611 418.0 1515 3171
Waiting: 671 1599 417.0 1500 3156
Total: 687 1611 418.0 1515 3171

Percentage of the requests served within a certain time (ms)
50% 1515
66% 1593
75% 1640
80% 1703
90% 2109
95% 2921
98% 3078
99% 3125
100% 3171 (longest request)

No comments :