Which one to use for process monitoring and why?
6 Answers
God leaks memory pretty badly so I chose Monit for my VPS. Monit runs at about 2MB of RAM constantly, whereas my god install running on Ruby 1.8.6 leaked out to about 60MB of RAM in about 36 hours. I didn't want to monitor my system monitoring tool so I scrapped God and went over to Monit and have had absolutely no problems.

- 5,496
- 1
- 28
- 35
-
Does anyone know if this problem still prevails with Ruby 1.8.7? I really like the "Rubyness" of god and I'd like to give it a shot, anyway. – Milan Novota Apr 21 '09 at 08:45
-
I'm not sure, if you are keen I'd say bear it in mind and give it a shot anyway. I'm not against God, I quite liked it, I just couldn't live with the leakage. The use of it was good, just not practical for me. – nitecoder Apr 21 '09 at 11:21
-
25God memory leak has been fixed about year ago (testing http://blog.vortorus.net/2009/12/06/god-process-monitor-0-8-0-major-improvement) – valodzka Oct 30 '10 at 13:57
-
6+1 for having used both and taken the time to share your experience – Chris McCauley Dec 10 '10 at 10:28
-
2It's been a long time since last post (2 years). Is it God still a good solution. Had god improved? does it have the memory leak problem? Is it a good choice? – Federico Dec 20 '12 at 13:08
-
Is it even possible to adequately fix the memory requirement of a ruby app for this task? If it needs to ask the system for more memory at all after startup, then it can die in a low memory situation. Can ruby be told to only use memory from a pre-allocated pool? – mc0e Oct 04 '14 at 14:45
Both solutions are good, and there are some pros and cons for both of them.
God config file is written in Ruby, so you can do basically everything Ruby allows you to do, and it's a lot of stuff. Monit has to be configured using its own syntax, it's usually OK but more restrictive. Anyway, you can also generate monit config with Ruby (as a part of your deployment strategy).
Also, monit uses less resources, so if you're on VPS or just don't have any spare memory, monit could be a better choice. Personally, I prefer god, as it's more configurable.
Here's a very good screencast on god. There's also a lot of feedback in comments to this screencast.

- 1,025
- 8
- 8
-
Yes, god's Ruby config file (as well as built-in XMPP notifier) makes it particularly tempting for me. And since I'm on my own dedicated server I think I'm going to give it a try. – Milan Novota Apr 21 '09 at 08:40
-
25Be sure to do your homework before you use god. There are some reliability problems that I've experienced as well as a few other folks I know that run major Rails applications. One thing god does very well is market itself as a magical, "easy", silver-bullet. Thats far from the truth. – Brad Gessler Jul 10 '09 at 23:17
-
1It appears you can't have one process depend on another in god? - This is a major issue. If you want to start your database before your web application, you can't! It will attempt to start both at the same time. I'm surprised no one has mentioned this. – Roman Gaufman Oct 17 '12 at 10:24
-
2Another useful thing to know; God requires root access, and the cn kernel module. These are not available on many dynamic cloud hosting services like heroku or dotcloud. – Stephen Belanger Feb 08 '13 at 19:46
God has a lot of problems including:
- It leaks memory
- It has trouble stopping and restarting processes
I did a write-up about it at http://blog.bradgessler.com/use-monit-with-rails-not-god
The only real problem with monit (if its a problem) is that the configuration files can get a bit verbose if you're running large clusters, but this could be solved with a templating system.

- 2,744
- 4
- 23
- 22
-
11We've been running monit on our clusters now for over three months and its one of the best sys-admin decisions we've made. Monit still hasn't crashed or leaked memory since we've turned it on. If you experienced the same frustrations I did with god and are peeved about it, I ask that you provide some link-bate to my blog post so when others Google "god" or "god process monitor" they can be warned with my rant. – Brad Gessler Jul 10 '09 at 23:16
-
2Looks like a generous contributor has helped to (possibly) eliminate the memory leaks in god. http://groups.google.com/group/god-rb/browse_thread/thread/86bec1664757086f – readonly Dec 12 '09 at 02:12
-
4God memory leak has been fixed about year ago (testing http://blog.vortorus.net/2009/12/06/god-process-monitor-0-8-0-major-improvement) – valodzka Oct 30 '10 at 13:58
-
3But unfortunately it continues to have trouble stopping and restarting processes. – Matthew Ratzloff Feb 06 '13 at 04:45
I had a ton of problems even getting God to run at all on my dedicated Ubuntu server. I eventually just gave up. Monit may not be Ruby, but it's largely hassle-free.

- 32,839
- 9
- 71
- 95
-
1
-
1Sure. $ sudo god check using event system: netlink starting event handler forking off new process forked process with pid = 15795 killing process [fail] never received process exit event – Bob Aman Apr 29 '09 at 12:57
To anyone finding this post going forward, you might also consider bluepill as an alternative to God. While I'd hope that God has addresses its memory issues in the past two years, I know bluepill was set out from the beginning to run on a small footprint. While still not as small as monit, bluepill's footprint is very reasonable (~16 MB VIRT, 13 MB RES for me).

- 11,285
- 1
- 43
- 60
-
2I like bluepill so far. Nice syntax, easy to use. But it has almost no documentation. Doing anything more than what's in the few examples requires reading over the code.. please just give me some basic docs that tell me what I can do with the thing. – Duke Oct 29 '11 at 10:37
Monit has its own issues:
- Empty PID files cause issues.
- If you have multiple levels of dependencies it starts up top level apps when lower level dependencies are started. This might be great for some use-cases, but its not particularly flexible.
At the moment I find it pretty annoying. Fortunately you can kinda kludge your way through the dependencies with their 'groups' feature, but its not particularly satisfying. Anyway, thats my take on v5.1.1

- 6,588
- 50
- 65
-
-
@oreoshake what do you mean? - God doesn't handle dependencies at all. The commenter was complaining that Monit doesn't handle nested dependencies very well, in God you can't specify to start a process after another at all! – Roman Gaufman Oct 17 '12 at 10:33
-
that was a rage comment, when I was in the thick of things and I was mostly talking about the PID issue, had no loading dependencies in my case. fixed things on my end, still using monit :) – oreoshake Oct 17 '12 at 16:40