Last Update: Mon Nov 07 12:18:43 PST 2005

Rails Analyzer Tools contains Bench, Crawler, RailsStat, IOTail and SyslogLogger libraries, and the programs bench, crawl and rails_stat based on these libraries.

I have used bench and crawl to tune the number of FastCGI processes running on, determine if HyperThreading would give a performance benefit or not (it did) and find a fatal threading bug in MySQL.

rails_stat is useful to see how much traffic your Rails site is doing.


Bench lets you benchmark the performance of a particular page. Simply give the URL, the number of requests to run and the number of threads to run in parallel.

You really, really, really don’t want to run bench against a live website.

  $ bench -u -r 50 -c 2
  Total time: 10.7073893547058
  Average time: 0.214147787094116


Crawler lets you exercise a server by crawling it really fast. It picks URLs at random from the returned page and always stays on the same host. When you kill it with a ^C it prints out a summary.

You really, really, really don’t want to run crawl against a live website.

  $ crawl -u -c 2
  GET / HTTP/1.0
  User-Agent: RubyCrawl


  Total time: 0.355171680450439
  Requests: 3
  Average time: 0.118390560150146


RailsStat displays the approximate number of requests, queries, and lines logged per second in 10 (or whatever) second intervals. Simply give it the path to your production log for a live Rails site and you’re done:

  $ rails_stat /var/log/production.log
  ~ 2.1 req/sec, 23.0 queries/sec, 32.8 lines/sec


SyslogLogger is a Logger replacement that logs to syslog. It is almost drop-in with a few caveats.


IOTail tails a file like the tail system utility. This lets you collect data from a live log file.