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
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.
- Minimize the amount of FCGI listeners
- Use caching
- NEVER run “development” on FastCGI for more than 1-2 hours
- Observe your memory consumption
- Rotate your logs
- Write and run unit tests
- Check for memory leaks when you are developing
- Be careful with iterations
- Watch the Rails TRAC for bug reports
- Be vigilant when restarting your server
And in detail . . . [TextDrive Weblog]