24 Apr 2009

Use Monit with Rails, not God

First, let me get a few things off my chest about God (the process monitor, I'm not being religious here)

"God - Process Monitoring Done Horribly Wrong"
"God (like monit, but doesn't work)"

Ok, I'm here to say that I hate the process monitor called God. Why? Because contrary to what Tom Preston-Werner says, it doesn't work and its not awesome. Where do I start?

Call a turd a turd
I have a serious problem with people in the Ruby community that throw a piece of crap, half baked open-source product out there, write about how "awesome" it is, build a lot of hype around it, and waste a lot of other peoples time for them to learn that the damn thing doesn't "just work". I don't care if something is version 0.0.5 and has serious problems, but call a turd a turd, not a Cadillac with shiney rims.

Can't stop (or start) daemons properly
Good luck wiring up God on Ubuntu to start a daemonized thin server. For some reason, thin exits with an exit code other than 0. Fine, ok, I understand that. That means I should be able to run thin without daemonizing it and have god daemonize for me, right? Nope, that doesn't work either. When you try to restart or stop a non-daemonized process in god it just won't work. Even if you manage getting a daemonized process running, God sometimes forgets about the pid and stops monitoring the process.

Straw buckets are leaky
Ruby leaks. God is written in ruby. If you run God long enough, it will run out of memory and stop working properly. In all fairness, this is not Tom Preston-Werner's fault. He spent a lot of time trying to minimize the leakage in God but its simply not possible in Ruby. Monit was written properly in C meaning it won't leak like a long-running Ruby application.

God is dead
The last commit to God on github was in February during the time this article went to Posterous. That means it has been over 2 months that god couldn't stop or restart a non-daemonized process. That seems like a serious bug that should be fixed pretty fast.

---

A dissection of bullshit
Just to drive this point home, I looked through the god website and found a few good quotes:

"God (like monit, only awesome)" - What the fuck does this mean? I'm not sure what's wrong with monit. Sure the configuration files seem a bit verbose if you have to monitor and bunch of servers, but one can get around this with some simple ruby code and ERB templates to generate the monitrc file. At least monit works.

"God is an easy to configure, easy to extend monitoring framework written in Ruby." - I don't trust people that sprinkle the word "easy" all over their software. When was the last time you trusted the phrase "easy to use" when evaluating a software package? This is something the end user should decide and is better left unsaid by the software developer. For me, god was impossible to use.

"FINALLY, A CONFIG FILE THAT MAKES SENSE" - Oh really? A giant ass ruby configuration file makes more sense than a monit configuration file? I beg the differ; monit has more documentation and is surprisingly laconic when compared to a god configuration file. With monit, you don't have to deal with nested blocks.

"That's it! Simple, huh?" - Yeah, so simple that it only takes 6 months to figure out that God doesn't actually work.

Tom, please tone down the hype on the http://god.rubyforge.org/ website and be more forthcoming about disclosing all of the issues that come with god. You make it look too easy, suck people in, and waste a lot of their time and energy. If you don't have time to maintain god thats understandable, but disclose that as well.

If there is one thing you walk away with from this post its that you do not use god to monitor your server processes. If you believe the Kool-aid on the god website you're in for a rough time. Consider monit, or any other process monitor that is not written in Ruby.