Tuesday, 19 February 2013

ApacheBench - A quick n' easy performance test for your REST applications


ApacheBench is only useful for benchmarking POST or GET requests but is quick to set up and gives details results.

ab – ApacheBench is should be installed by default on Ubuntu




Example:



ab -n 100 -T 'application/xml' -A 'user:password' -p customer.xml -d http://172.18.48.67:8080/ws/1.1.1/resources/customers

-n number of requests
-c number of threads
-T content-type
-A authentication
-p POST filename

The output:

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 172.18.48.67 (be patient).....done


Server Software:        Apache-Coyote/1.1
Server Hostname:      172.18.48.67
Server Port:                8080

Document Path:            /ws/1.1.1/resources/customers
Document Length:        1035 bytes

Concurrency Level:        1
Time taken for tests:       660.109 seconds
Complete requests:         100
Failed requests:              0
Write errors:                  0
Total transferred:           132700 bytes
Total POSTed:               79000
HTML transferred:       103500 bytes
Requests per second:    0.15 [#/sec] (mean)
Time per request:          6601.087 [ms] (mean)
Time per request:         6601.087 [ms] (mean, across all concurrent requests)
Transfer rate:               0.20 [Kbytes/sec] received
                                    0.12 kb/s sent
                                    0.31 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.2      0      11
Processing:  5363 6601 810.4   6590    8179
Waiting:     5362 6600 810.2   6590    8178
Total:       5363 6601 810.3   6590    8179

No comments:

Post a Comment