github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

igrigorik / autoperf

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 93
    • 9
  • Source
  • Commits
  • Network (9)
  • Issues (0)
  • Downloads (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…

Ruby driver for httperf - automated load and performance testing — Read more

  Cancel

http://www.igvita.com/2008/09/30/load-testing-with-log-replayload-testing-with-log-replay/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

sample configs for replay and pure request drivers 
igrigorik (author)
Sat Jun 19 15:16:09 -0700 2010
commit  085959d52c629d12fa97
tree    53965ae4e3816f1b9dc5
parent  d732e18377a9b95ddc19
autoperf /
name age
history
message
file README Sat Jun 19 15:09:08 -0700 2010 Merge branch 'master' of git://github.com/pauld... [igrigorik]
file autoperf.rb Sat Jun 19 15:13:02 -0700 2010 Merge branch 'fix_uri' of git://github.com/kama... [igrigorik]
file make_replay_log.rb Sun Apr 25 02:06:50 -0700 2010 Add script to generate replay_log from access_log. [kjwierenga]
file replay_sample.conf Sat Jun 19 15:16:09 -0700 2010 sample configs for replay and pure request drivers [igrigorik]
file requests_sample.conf Sat Jun 19 15:16:09 -0700 2010 sample configs for replay and pure request drivers [igrigorik]
README
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-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 | 5xx status | net io (KB/s) |
+-----------------------------------------------------------------------------+
|  100 | 99.9   | 99.9  | 99.7          | 0      | 0          | 45.4          |
|  120 | 119.7  | 119.7 | 120.0         | 0      | 0          | 54.4          |
|  140 | 139.3  | 139.3 | 138.0         | 0      | 0          | 63.6          |
|> 160 | 151.9  | 151.9 | 147.0         | 0      | 0          | 69.3          |
|  180 | 132.2  | 129.8 | 137.4         | 27     | 0          | 59.6          |
|  200 | 119.8  | 117.6 | 139.9         | 31     | 14         | 53.9          |
+-----------------------------------------------------------------------------+

If your server uses caching, making it pointless to run the same requests over
and over, you can use different requests for each run.

# Create 10 1000-line files (xa, xb, xc etc)
split -a 1 requests_path

# Convert to null-terminated strings
for x in x?; do tr "\n" "\0" < $x > $x.nul; done

# run as before, but use the `wlog` line instead of `httperf_wlog` in the conf file
ruby autoperf.rb -c sample.conf
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文