Deploying Rails Applications - talk at Barcamp Bangalore 3

Posted on April 13, 2007

I did a talk was on Deploying Rails Applications at Barcamp Bangalore 3. Around 20 folks turned up, which was great considering that it was one of the last talks of the day. The LCD projector needed a fair amount of tweaking before it finally came to life, so we ended up starting a bit later than planned.

The slides are here.


The audience had questions about virtualization, Nginx and debugging RoR apps, and we ended up with a nice discussion on Rails hosting options. Gitu has a pretty flattering review of my talk:

Deploying Rails Applications – Vivek Prahlad
This was a kind of a neat demo i liked the most. Vivek gave a neat presentation on deploying Rails applications and also gave a real time experience of how it works behind with his blog. FYI his blog runs on RubyonRails.

One of things I talked about was about how I’d used a combination of Monit, Cron, Nginx, PostgreSQL and Mephisto to create this site. My aim had been to put together a self-healing setup that would essentially take care of itself with minimal manual intervention. (This blog runs on a 256MB VPS from SliceHost. The site has been up for approximately one and a half months, and the total memory usage is around 200 MB. The mongrel cluster runs a pair of mongrels).

Monit is really what brings it all together – it now seems to be the monitoring tool of choice for RoR applications. (If you’d like to know more about Monit, check out this post). I especially like the natural language syntax the the Monit configuration uses:

# eating up memory?
if totalmem is greater than 60.0 MB for 5 cycles then restart
# high cpu load?
if cpu is greater than 50% for 2 cycles then alert
# hung process?
if cpu is greater than 80% for 3 cycles then restart
# bad, bad, bad
if loadavg(5min) greater than 10 for 8 cycles then restart
# something is wrong, call the sys-admin      
if 3 restarts within 5 cycles then timeout                         
 

I was pretty happy with how the talk went, considering that I’d put the slides together after putting up the topic on the board!