Friday, July 06, 2007

install ruby gc patch and usage of railsbench

use one of: base, comp, comp_gc, convert_raw_data_files, diff, diff_gc, generate
_benchmarks, help, html, install, path, perf_comp, perf_comp_gc, perf_diff, perf
_diff_gc, perf_html, perf_plot, perf_plot_gc, perf_prof, perf_run, perf_run_gc,
perf_table, perf_tex, perf_times, perf_times_gc, plot, plot_gc, postinstall, pro
f, readme, run, run_gc, run_urls, table, tex, times, times_gc
'railsbench help' displays README
'railsbench cmd help' displays help for given command


STEP 1: installing railsbench and PATH modification

If you obtained and installed railsbench as a gem, a script called
railsbench is available in your Ruby bin directory. railsbench is a
simple driver for the railsbench scripts, which are located in the gem
installation directory. Example:

railsbench perf_run 100 -bm=all

Alternatively, add the railsbench script directory to your search
path. The exact place can be found running

railsbench base

which prints the script directory path. Another option is to run

eval `railsbench path`

Since gem packages don't support running postinstall scripts, you will
need to make the scripts executable by running

sudo railsbench postinstall

After performing these steps, individual commands can be run directly:

perf_run 100 -bm=all

# benchmark.yml
# default:
# uri: /
# all:
# uri: /admin

The environment variable RAILS_ROOT must be set and point to your apps
base directory, in order for railsbench to work properly.

If you obtained railsbench as a svn checkout, add the railsbench
script directory to your search path.

STEP 2: prepare your application for benchmarking

Manual installation:

Copy benchmarks.rb and benchmarks.yml into $RAILS_ROOT/config and
edit them to suit your needs. The provided default benchmark.yml
will run the root URL of your app.

Copy benchmarking.rb to $RAILS_ROOT/config/environments and add a
corresponding section to database.yml.

Automatic installation:

Run 'railsbench install'. This will perform all of the above steps
and create a configuration named 'benchmarking' in database.yml
pointing to your development database. In case you are worrying
about possible results, you can call railsbench install --dry-run

In either case, run `railsbench generate_benchmarks'. This will create
a benchmarks.yml file with a benchmark for each controller and action.

STEP 3: optional (but highly recommended)

Patch the ruby garbage collector using rubygc18{45}.patch, depending
on your ruby version. Recompile ruby and copy the ruby binary and
shared libs to where they were previously installed. See GCPATCH for
details on how to influence the patched ruby gc.

[root@localhost soft]$ sudo gem install railsbench
Bulk updating Gem source index for:
Successfully installed railsbench-0.9.2
[root@localhost soft]$ cd ruby-1.8.5
[root@localhost ruby-1.8.5]$ pa
pal2rgb pango-querymodules-32 passwd patch pax
pand paps paste pathchk
[root@localhost ruby-1.8.5]$ pat
patch pathchk
[root@localhost ruby-1.8.5]$ patch -p0 < /usr/local/ruby/
bin/ lib/ share/
[root@localhost ruby-1.8.5]$ patch -p0 < /usr/local/ruby/lib/
libruby-static.a ruby/
[root@localhost ruby-1.8.5]$ patch -p0 < /usr/local/ruby/lib/ruby/
1.8/ gems/ site_ruby/
[root@localhost ruby-1.8.5]$ patch -p0 < /usr/local/ruby/lib/ruby/gems/1.8/gems/railsbench-0.9.2/
bin/ config/ lib/ postinstall.rb README script/
BUGS INSTALL LICENSE PROBLEMS ruby184gc.patch setup.rb
CHANGELOG install.rb Manifest.txt Rakefile ruby185gc.patch test/
[root@localhost ruby-1.8.5]$ patch -p0 < /usr/local/ruby/lib/ruby/gems/1.8/gems/railsbench-0.9.2/ruby185gc.patch
patching file gc.c
Hunk #2 succeeded at 62 (offset 14 lines).
Hunk #4 succeeded at 225 (offset 14 lines).
Hunk #6 succeeded at 428 (offset 14 lines).
Hunk #8 succeeded at 582 (offset 14 lines).
Hunk #10 succeeded at 618 (offset 14 lines).
Hunk #11 succeeded at 1254 (offset -3 lines).
Hunk #12 succeeded at 1334 (offset 14 lines).
Hunk #13 succeeded at 1364 (offset -3 lines).
Hunk #14 succeeded at 1391 (offset 14 lines).
Hunk #15 succeeded at 1393 (offset -3 lines).
Hunk #16 succeeded at 1431 (offset 14 lines).
Hunk #17 succeeded at 1422 (offset -3 lines).
Hunk #18 succeeded at 1647 (offset 14 lines).
Hunk #19 succeeded at 1647 (offset -3 lines).
Hunk #20 succeeded at 1760 (offset 27 lines).
Hunk #21 succeeded at 1854 (offset -58 lines).
Hunk #22 succeeded at 2409 (offset 27 lines).

No comments :