Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sample app for learning about performance testing
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data
log
.gitignore
Gemfile
Gemfile.lock
README.md
app.rb
config.ru

README.md

Performance Testing

This is a sample application used for learning performance testing.

Setup

  1. git clone this repository
  2. bundle install

Run the application

It's useful to run the application using a number of different servers, e.g. WEBrick, thin, puma, and unicorn.

rackup -s webrick -p 9000
rackup -s thin -p 9000
rackup -s puma -p 9000
unicorn -p 9000

Doing a benchmark

10 concurrent connections that will each run 100 requests:

GET request

ab -n 100 -c 10 http://0.0.0.0:9000/

POST request

ab -n 10 -c 2 -p data/small.json -T 'application/json' http://0.0.0.0:9000/

You may want to generate the results to a CSV file, so that you can graph the results:

ab -n 100 -c 10 -e filename.csv http://0.0.0.0:9000/

If you'd like to use GNUplot, then generate tab-delimited files instead:

ab -n 100 -c 10 -g filename.dat http://0.0.0.0:9000/
Something went wrong with that request. Please try again.