ab -n 1000 URL - this does 1000 requests to the URL. No problems here.
ab -t 60 URL - this always does requests to the URL for 60 seconds. WRONG
-t timelimit Seconds to max. wait for responses
-t timelimit
Maximum number of seconds to spend for benchmarking. This implies
a -n 50000 internally. Use this to benchmark the server within a fixed total
amount of time. Per default there is no timelimit.
ab -n 1000000000 -t 60 URL WRONG. This will still set the -n to 50k
ab -t 60 -n 1000000000 URL RIGHT
case 'n':
requests = atoi(optarg);
if (requests <= 0) {
err("Invalid number of requests\n");
}
break;
case 't':
tlimit = atoi(optarg);
requests = MAX_REQUESTS; /* need to size data array on
* something */
break;
# curl -i http://localhost/helloworld.htm
HTTP/1.1 200 OK
Date: Thu, 08 Sep 2011 21:55:29 GMT
Server: Apache/2.2.3 (CentOS) PHP/5.3.6 mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5
Last-Modified: Thu, 08 Sep 2011 07:27:04 GMT
ETag: "5f6d86-c-4ac68fcc22200"
Accept-Ranges: bytes
Content-Length: 12
Content-Type: text/html
hello world
ab -k -c 1 -n 100000 http://localhost/helloworld.htm
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 localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Finished 100000 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /helloworld.htm
Document Length: 12 bytes
Concurrency Level: 1
Time taken for tests: 3.549480 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 100000
Total transferred: 34200000 bytes
HTML transferred: 1200000 bytes
Requests per second: 28173.14 [#/sec] (mean)
Time per request: 0.035 [ms] (mean)
Time per request: 0.035 [ms] (mean, across all concurrent requests)
Transfer rate: 9409.27 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 0
Waiting: 0 0 0.0 0 0
Total: 0 0 0.0 0 0
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 0 (longest request)
ab -k -c 1 -t 60 http://localhost/helloworld.htm
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 localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Finished 50000 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /helloworld.htm
Document Length: 12 bytes
Concurrency Level: 1
Time taken for tests: 1.774499 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 50000
Total transferred: 17100000 bytes
HTML transferred: 600000 bytes
Requests per second: 28176.97 [#/sec] (mean)
Time per request: 0.035 [ms] (mean)
Time per request: 0.035 [ms] (mean, across all concurrent requests)
Transfer rate: 9410.54 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 0
Waiting: 0 0 0.0 0 0
Total: 0 0 0.0 0 0
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 0 (longest request)
ab -k -c 1 -n 10000000 -t 60 http://localhost/helloworld.htm
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 localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Finished 50000 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /helloworld.htm
Document Length: 12 bytes
Concurrency Level: 1
Time taken for tests: 1.722899 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 50000
Total transferred: 17100000 bytes
HTML transferred: 600000 bytes
Requests per second: 29020.85 [#/sec] (mean)
Time per request: 0.034 [ms] (mean)
Time per request: 0.034 [ms] (mean, across all concurrent requests)
Transfer rate: 9692.38 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 0
Waiting: 0 0 0.0 0 0
Total: 0 0 0.0 0 0
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 0 (longest request)
ab -k -c 1 -t 60 -n 10000000 http://localhost/helloworld.htm
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 localhost (be patient)
Completed 1000000 requests
Finished 1623764 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /helloworld.htm
Document Length: 12 bytes
Concurrency Level: 1
Time taken for tests: 60.044 seconds
Complete requests: 1623764
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1623764
Total transferred: 555327288 bytes
HTML transferred: 19485168 bytes
Requests per second: 27062.71 [#/sec] (mean)
Time per request: 0.037 [ms] (mean)
Time per request: 0.037 [ms] (mean, across all concurrent requests)
Transfer rate: 9038.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 0
Waiting: 0 0 0.0 0 0
Total: 0 0 0.0 0 0
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 0 (longest request)
ab -k -c 10 -t 60 -n 10000000 http://localhost/helloworld.htm
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 localhost (be patient)
Completed 1000000 requests
Completed 2000000 requests
Completed 3000000 requests
Completed 4000000 requests
Completed 5000000 requests
Completed 6000000 requests
Finished 6988682 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /helloworld.htm
Document Length: 12 bytes
Concurrency Level: 10
Time taken for tests: 60.022 seconds
Complete requests: 6988682
Failed requests: 0
Write errors: 0
Keep-Alive requests: 6988682
Total transferred: 2390129244 bytes
HTML transferred: 83864184 bytes
Requests per second: 116477.99 [#/sec] (mean)
Time per request: 0.086 [ms] (mean)
Time per request: 0.009 [ms] (mean, across all concurrent requests)
Transfer rate: 38901.82 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 1
Waiting: 0 0 0.0 0 1
Total: 0 0 0.0 0 1
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 1 (longest request)
curl -i http://localhost/hw.php
HTTP/1.1 200 OK
Date: Fri, 09 Sep 2011 16:43:27 GMT
Server: Apache/2.2.3 (CentOS) PHP/5.3.6 mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5
X-Powered-By: PHP/5.3.6
Content-Length: 12
Content-Type: text/html
hello world
ab -k -c 10 -t 60 -n 10000000 http://localhost/hw.php
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 localhost (be patient)
Completed 1000000 requests
Completed 2000000 requests
Completed 3000000 requests
Finished 3994856 requests
Server Software: Apache/2.2.3
Server Hostname: localhost
Server Port: 80
Document Path: /hw.php
Document Length: 12 bytes
Concurrency Level: 10
Time taken for tests: 60.029 seconds
Complete requests: 3994856
Failed requests: 0
Write errors: 0
Keep-Alive requests: 3994856
Total transferred: 1066626552 bytes
HTML transferred: 47938272 bytes
Requests per second: 66580.90 [#/sec] (mean)
Time per request: 0.150 [ms] (mean)
Time per request: 0.015 [ms] (mean, across all concurrent requests)
Transfer rate: 17360.44 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 6
Waiting: 0 0 0.0 0 6
Total: 0 0 0.0 0 6
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 6 (longest request)
About Us
Contacts FAQ Terms of Use Privacy Policy Sign Up! SitemapAdvertise
AdvertisingCool Features
Submit a Story Product Photos Videos Privacy RequestRSS
Pinkbike RSS Pinkbike Twitter Pinkbike Facebook Pinkbike Youtube
It solved 2 problems I had:
- I was using the parameters wrong
- My IP wasn't reachable