Meditations, Musings and Memorial Stones

AVANIM :: TecHarmony :: Optimizing Rails

Optimizing Rails

January 31, 2006 | Comments: 1

For web hosts and developers, this is a big issue. If Rails is not managed well, it can become a huge drain on system resources.

Here are some excellent guidelines to review. We welcome comments!
NOTE: We suggest putting all of the following in a daily cronjob to keep your ruby runtime environment fresh. In this script you should stop apache and/or lighttpd first, then start them up after the cleanup operations are complete.

Get rid of stale dispatch processes

Whether you are running Apache or Lighttpd, dispatch.fcgi processes, once started, don’t clean themselves up. Therefore it is a good idea when restarting Apache and/or Lighttpd to check for any stale dispatch.fcgi processes, and get rid of them:

## Kill stale dispatch.fcgi processes 
killall -9 dispatch.fcgi

Purge old ruby sessions

## Purge Ruby sessions 1 day (24 hours) old and over
find /tmp/ -name 'ruby_sess*' -ctime -1|xargs rm -rf

Comments

Thanks Nathaniel. Points well taken!


Andrew vonderLuft on February 26, 2006 at 01:53 AM

Post a comment


(required, but not displayed)

(optional)


(required)