Railsbench

Install

#sudo gem install railsbench 

(install path on my mac: /opt/local/lib/ruby/gems/1.8/gems/railsbench-0.9.0)

 

Configuration

1. set $RAILS_ROOT

eg. on my mac, edit ~/.bash_profile, add a path as below:

export RAILS_ROOT=”/Users/suave/rubyapps/rails_app”

 

2. #railsbench base

   or

   #eval ‘railsbench path’

 

3. #sudo railsbench postinstall 

 

Prepare your application

1. #railsbench install

(copy benchmarks.rb and benckmarks.yml to your rails_app/config, copy benchmarking.rb to your rails_app/config/environments)

 

2. edit benchmarks.yml as what you want

 

Run railsbench

#railsbench perf_run 100 -bm=all

(”all” is a target specified in benchmarks.yml)

 

Environments

RAILS_ROOT

          must be set to point to your rails app

RAILS_PERF_DATA

          performance data sets will be stored into this directory
            if not set, $HOME will be used

RAILS_PERF_RUNS

          the number of times perf_loop will run perf_bench on a single invocation
            if not set, 3 runs will be performed

RAILS_BENCHMARK_FILE

          perf_bench send it’s output to this file

 

See http://railsbench.rubyforge.org/ or README under your railsbench install path to know more :-)

Tags: , ,

Leave a Reply