Difference between revisions of "Benchmarking and Load Testing with Apache Bench(AB)"
From Brian Nelson Ramblings
(Created page with "==Benchmarking and Load Testing with Apache Bench(AB)== ApacheBench (ab) is a very handy webserver benchmarking tool which can be run from command line. It is extremely simpl...") |
(→Using AB Testing on Centos) |
||
Line 9: | Line 9: | ||
Let run our first test, | Let run our first test, | ||
− | ab -n | + | ab -n 100 -c 10 http://www.briansnelson.com/Main_Page |
− | + | ||
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | This is ApacheBench, Version 2.3 <$Revision: 655654 $> | ||
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | ||
Licensed to The Apache Software Foundation, http://www.apache.org/ | Licensed to The Apache Software Foundation, http://www.apache.org/ | ||
− | Benchmarking www.briansnelson.com (be patient) | + | Benchmarking www.briansnelson.com (be patient).....done |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
Server Software: Apache | Server Software: Apache | ||
Server Hostname: www.briansnelson.com | Server Hostname: www.briansnelson.com | ||
− | Server Port: 80 | + | Server Port: 80 |
Document Path: /Main_Page | Document Path: /Main_Page | ||
− | Document Length: 30431 bytes | + | Document Length: 30431 bytes |
− | Concurrency Level: | + | Concurrency Level: 10 |
− | Time taken for tests: | + | Time taken for tests: 0.433 seconds |
− | Complete requests: | + | Complete requests: 100 |
− | Failed requests: | + | Failed requests: 0 |
− | + | ||
Write errors: 0 | Write errors: 0 | ||
− | Total transferred: | + | Total transferred: 3084500 bytes |
− | HTML transferred: | + | HTML transferred: 3043100 bytes |
− | Requests per second: | + | Requests per second: 231.15 [#/sec] (mean) |
− | Time per request: | + | Time per request: 43.262 [ms] (mean) |
− | Time per request: | + | Time per request: 4.326 [ms] (mean, across all concurrent requests) |
− | Transfer rate: | + | Transfer rate: 6962.71 [Kbytes/sec] received |
Connection Times (ms) | Connection Times (ms) | ||
min mean[+/-sd] median max | min mean[+/-sd] median max | ||
− | Connect: 9 | + | Connect: 9 9 0.4 9 11 |
− | Processing: | + | Processing: 28 32 2.7 31 53 |
− | Waiting: | + | Waiting: 9 10 1.3 10 16 |
− | Total: 41 | + | Total: 39 41 2.8 40 61 |
− | + | ||
− | + | Percentage of the requests served within a certain time (ms) | |
− | + | 50% 40 | |
− | + | 66% 41 | |
− | + | 75% 41 | |
− | + | 80% 42 | |
− | + | 90% 44 | |
− | + | 95% 46 | |
− | + | 98% 49 | |
− | + | 99% 61 | |
− | + | 100% 61 (longest request) | |
Lets break down the request we used with the ab command | Lets break down the request we used with the ab command |
Revision as of 18:53, 18 March 2014
Benchmarking and Load Testing with Apache Bench(AB)
ApacheBench (ab) is a very handy webserver benchmarking tool which can be run from command line. It is extremely simple to use. A quick outcome can be obtained in just one minute. It does not require too much much familiarity with load and performance testing concepts. No complex setup is required. It gets installed automatically with apache. It does not have all the features of more popular tools, but it is good for a start.
Using AB Testing on Centos
One thing to not, you should never run ab on your localhost against your localhost.
Let run our first test,
ab -n 100 -c 10 http://www.briansnelson.com/Main_Page
This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking www.briansnelson.com (be patient).....done Server Software: Apache Server Hostname: www.briansnelson.com Server Port: 80 Document Path: /Main_Page Document Length: 30431 bytes Concurrency Level: 10 Time taken for tests: 0.433 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 3084500 bytes HTML transferred: 3043100 bytes Requests per second: 231.15 [#/sec] (mean) Time per request: 43.262 [ms] (mean) Time per request: 4.326 [ms] (mean, across all concurrent requests) Transfer rate: 6962.71 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 9 9 0.4 9 11 Processing: 28 32 2.7 31 53 Waiting: 9 10 1.3 10 16 Total: 39 41 2.8 40 61
Percentage of the requests served within a certain time (ms)
50% 40 66% 41 75% 41 80% 42 90% 44 95% 46 98% 49 99% 61 100% 61 (longest request)
Lets break down the request we used with the ab command
- -n is the total number of request to make
- -c is the number of concurrent connections to make
- and last is the domain name/url you wish to test on