igrigorik / autoperf

Ruby driver for httperf - automated load and performance testing

igrigorik (author)
Tue Sep 30 06:34:34 -0700 2008
commit  d9167dddd5153454a49861861f77d09548414f00
tree    ed54dc3c5d5b9c8d875b2898156625779880b945
parent  39d04d30164761028b34ec38318a9161856da297
autoperf / README
100644 36 lines (27 sloc) 1.746 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Autoperf is a ruby driver for httperf, designed to help you automate load and performance
testing of any web application - for a single end point, or through log replay.
 
More: http://www.igvita.com/2008/09/30/load-testing-with-log-replayload-testing-with-log-replay/
 
To get started, first download & install httperf:
http://www.hpl.hp.com/research/linux/httperf/
 
Next, either run a simple test straight from the command line (man httperf), or create
an execution plan for autoperf. If you want to replay an access log from your production
environment, follow these steps:
 
# grab last 10000 lines from nginx log, and extract a certain pattern (if needed)
tail -n 10000 nginx.log | grep "__pattern__" > requests
 
# extract the request path (ex. /homepage) from the log file
awk '{print $7}' requests > requests_path
 
# replace newlines with null terminators (httperf format)
tr "\n" "\0" < requests_path > replay_log
 
Next, configure your execution plan (see sample.conf), and run autoperf:
ruby autoperf.rb -c sample.conf
 
Sample output:
+----------------------------------------------------------------+
| rate | conn/s | req/s | replies/s avg | errors | net io (KB/s) |
+----------------------------------------------------------------+
| 100 | 99.9 | 99.9 | 99.7 | 0 | 45.4 |
| 120 | 119.7 | 119.7 | 120.0 | 0 | 54.4 |
| 140 | 139.3 | 139.3 | 138.0 | 0 | 63.6 |
|> 160 | 151.9 | 151.9 | 147.0 | 0 | 69.3 |
| 180 | 132.2 | 129.8 | 137.4 | 27 | 59.6 |
| 200 | 119.8 | 117.6 | 139.9 | 31 | 53.9 |
+----------------------------------------------------------------+