Have God watch over your processes; or How to keep your app running when your not watching
My latest application at work is a Ruby on Rails(RoR) app, that we just deployed recently. Being a RoR app it hasn’t been so pleasant in production. I’m sure that it is due to my lack of experience in deploying RoR apps, but it has been difficult in any case. It is deployed to a cluster of 3 mongrels behind an apache proxy/load balancer. Just this morning the app became unresponsive as one of the mongrel instances was hung and had the cpu pegged. Not hard to fix, killed the processes and restarted the cluster. More of a nuisance really.
The problem, though, is that if this keeps happening (it most likely will), it would be more than just a nuisance. We needed to find a way to monitor the app to make sure it was always running. Luckily there is a product out there that does more than just monitor your app. Luckily I found God ;). From the God website:
“God is an easy to configure, easy to extend monitoring framework written in Ruby.
Keeping your server processes and tasks running should be a simple part of your deployment process. God aims to be the simplest, most powerful monitoring application available.”
It doesn’t lie. It is one of the best pieces of software that I have used in a little while now. I was up and running in about 30 minutes. Most of that time was spent checking out the different options and whatnot. So now if one of the mongrels fails for some reason, God will start it back up. If one of the mongrels is using too much memory, God will restart it. If one of the mongrels is pegging the processor, God will restart it. You can even watch the logs in real time for each individual mongrel instance, and control God from the command line. There is also a great tutorial on loading God on system startup.
If you’re interested make sure you read through the home page for God to see all the great things it is capable of.


November 12th, 2008 at 2:36 pm
obgtkxqta4c6c98k