Optimizing Rails Resource Usage

Optimizing Rails Resource Usage.

my name is Julik and I'm one of the new guest writers on the
TextDrive weblog. Jason has given me the privilege to talk a little
about performance-tuning Rails applications for deployment on TextDrive
or anywhere.

I've been doing Rails development since
April 2005 and have deployed 3 applications already, all for client
use. Since then I have encountered quite some problems which are not
covered well on the Rails wiki, partly because they pertain to running
Rails on shared hosting accounts.

Rails is nuclear
stuff, it allows you to do wonders in minutes but you have to be
careful with it. The amount of magic contained in Rails imposes quite
an overhead — that you, as a developer, are obliged
to manage. These things not only make your application faster, scalable
and tolerant, but also bearable for people living on the same web and
application servers. Failures to do this in a shared heteregenous
environment certifably leads to memory leaks and hard crashes. These
tips are good standard procedures for a Rails application at any level
(even if you are on a dedicated cluster setup).

So here it goes, a list of 10 things I recommend to do to streamline your application and make it more bearable for others.

In short,

  1. Minimize the amount of FCGI listeners
  2. Use caching
  3. NEVER run “development” on FastCGI for more than 1-2 hours
  4. Observe your memory consumption
  5. Rotate your logs
  6. Write and run unit tests
  7. Check for memory leaks when you are developing
  8. Be careful with iterations
  9. Watch the Rails TRAC for bug reports
  10. Be vigilant when restarting your server

And in detail . . .  [TextDrive Weblog]

Leave a comment