public
Description: A Better Load Simulator
Homepage: http://jamesgolick.com/2009/6/4/introducing-trample-a-better-load-simulator.html
Clone URL: git://github.com/giraffesoft/trample.git
Click here to lend your support to: trample and make a donation at www.pledgie.com !
name age message
file .gitignore Tue Apr 28 13:43:09 -0700 2009 Initial commit to trample. [giraffesoft]
file LICENSE Tue Apr 28 13:43:09 -0700 2009 Initial commit to trample. [giraffesoft]
file README.rdoc Mon May 11 06:02:53 -0700 2009 more edits [giraffesoft]
file Rakefile Tue Apr 28 13:43:09 -0700 2009 Initial commit to trample. [giraffesoft]
file VERSION.yml Thu Jun 04 11:44:50 -0700 2009 Version bump to 0.1.0 [giraffesoft]
directory bin/ Thu Apr 30 08:08:50 -0700 2009 add trample binary [giraffesoft]
directory lib/ Thu Jun 04 11:36:08 -0700 2009 make sure GETs can have config parameters [giraffesoft]
directory test/ Thu Jun 04 11:36:08 -0700 2009 make sure GETs can have config parameters [giraffesoft]
file trample.gemspec Thu Jun 04 11:45:55 -0700 2009 Regenerated gemspec for version 0.1.0 [giraffesoft]
README.rdoc

trample

Trample is a flexible load simulation tool.

Most load sim tools make requests to a static list of urls. They spawn n threads and make requests to the urls on the list in succession, in each thread. Unfortunately, though, if your applicaition makes use of any kind of caching (including your database’s internal caching facilities), this kind of load simulation is unrealistic.

The data required to serve a single set of urls is likely to fit nicely in the database server’s cache (even on a small server). So, having a single user hammer a finite set of pages will make your application look much faster than it really is.

Trample allows you to provide parameter values inside of a block (a lambda function, for non-rubyists). The block is executed each time the parameters are needed. So, if you use randomization in the block, you should (theoretically) get different values every time.

That way, you can have trample log in as several different users and request different data in each session.

How To

Trample uses a ruby DSL for configuration.

  Trample.configure do
    concurrency 5
    iterations  10
    login do
      post "http://yoursite.com/login" do
        {:username => User.random.username, :password => "swordfish"}
      end
    end
    get  "http://yoursite.com/somewhere"
    post "http://yoursite.com/something" do
      {:a_parameter => "a value"}
    end
    get  "http://yoursite.com/someresources/:id" do
      {:id => SomeResource.random.id}
    end
  end

The above configuration will start 5 (concurrency) sessions by logging in as a random user at the url in the login block. Then, it’ll hit the two urls underneath it 10 (iterations) times during each session.

To run trample, save your configuration somewhere and run:

  trample start /path/to/your/trample/config.rb

Copyright

Copyright © 2009 James Golick. See LICENSE for details.