Git Product home page Git Product logo

autoperf's Introduction

Autoperf (w/ HTTPerf.rb)

Gem Version ย  Build Status

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.

This has been refactored from the original -- github.com/igrigorik/autoperf -- to include HTTPerf.rb as a simplification and to include additional features. This has been refactored and released with permission from Ilya Grigorik, the original author.

More info on the original Autoperf: http://www.igvita.com/2008/09/30/load-testing-with-log-replay/.

Requirements

To get started, first download & install httperf: http://www.hpl.hp.com/research/linux/httperf/.

Or for HTTPerf.rb percentile support, install this fork: http://github.com/jmervine/httperf.

Rubies

It's important to note that tests pass for this on the following Ruby versions, but I've only used this at length on 1.9.2p290.

  • 1.9.3p392
  • 2.0.0p0

Note: I was also able to get tests to pass on 1.8.7 and 1.9.2, but not on Traivs and I would consider it unstable on both.

Installation

:::shell
gem install bundler
echo 'gem "autoperf"' >> Gemfile
bundle install

Without bundler:

:::shell
gem install autoperf

From source:

:::shell
git clone git://github.com/rubyops/autoperf.git
cd autoperf
gem build autoperf.gemspec
gem install ./autoperf-VERSION.gem

Usage

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:

:::shell
# grab last 10000 lines from nginx log, and extract a certain pattern (if needed)
tail -n 10000 nginx.log | bundle exec make_replay_log > replay_log

Next, configure your execution plan (see sample.yml), and run autoperf:

:::shell
bundle exec autoperf -c sample.yml

Sample output:

+-------------------------------------------------------------------------------------------------------------------------------+
| rate | connection_rate_per_sec | request_rate_per_sec | connection_time_avg | errors_total | reply_status_5xx | net_io_kb_sec |
+-------------------------------------------------------------------------------------------------------------------------------+
|    5 | 154.4                   | 154.4                | 6.5                 | 0            | 0                | 1176.9        |
|   10 | 153.4                   | 153.4                | 6.5                 | 0            | 0                | 1169.5        |
|   15 | 153.0                   | 153.0                | 6.5                 | 0            | 0                | 1166.6        |
|   20 | 147.4                   | 147.4                | 6.8                 | 0            | 0                | 1123.4        |
+-------------------------------------------------------------------------------------------------------------------------------+

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

:::shell
# 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
autoperf -c sample.yml

autoperf's People

Contributors

dvrensk avatar igrigorik avatar jmervine avatar kamal avatar kjwierenga avatar pauldowman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nangus

autoperf's Issues

Block in run error

autoperf/lib/autoperf.rb:37:in block in run' autoperf/lib/autoperf.rb:35:instep'
autoperf/lib/autoperf.rb:35:in `run'

Don't work

root@kubernetes-master:/autoperf# gem build autoperf.gemspec
WARNING:  licenses is empty, but is recommended.  Use a license identifier from
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
WARNING:  pessimistic dependency on rake (~> 10.0.4, development) may be overly strict
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 10.0', '>= 10.0.4'
WARNING:  pessimistic dependency on minitest (~> 4.7.1, development) may be overly strict
  if minitest is semantically versioned, use:
    add_development_dependency 'minitest', '~> 4.7', '>= 4.7.1'
WARNING:  pessimistic dependency on ruport (~> 1.6.3) may be overly strict
  if ruport is semantically versioned, use:
    add_runtime_dependency 'ruport', '~> 1.6', '>= 1.6.3'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: autoperf
  Version: 1.1.0
  File: autoperf-1.1.0.gem
root@kubernetes-master:/autoperf# gem install ./autoperf-VERSION.gem
ERROR:  Could not find a valid gem './autoperf-VERSION.gem' (>= 0) in any repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.