God vs. Monit for process monitoring [closed]
Asked Answered
F

6

59

Which one to use for process monitoring and why?

Faizabad answered 20/4, 2009 at 13:13 Comment(0)
M
48

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.

Madalynmadam answered 20/4, 2009 at 14:3 Comment(4)
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.Faizabad
Be 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.Overtask
It 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.Department
Another 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.Stirps
I
50

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.

Irrepealable answered 21/4, 2009 at 0:15 Comment(6)
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.Faizabad
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.Irrepealable
God memory leak has been fixed about year ago (testing blog.vortorus.net/2009/12/06/…)Distraint
+1 for having used both and taken the time to share your experienceDenna
It'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?Rostellum
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?Phew
M
48

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.

Madalynmadam answered 20/4, 2009 at 14:3 Comment(4)
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.Faizabad
Be 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.Overtask
It 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.Department
Another 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.Stirps
O
22

God has a lot of problems including:

  1. It leaks memory
  2. 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.

Overtask answered 29/4, 2009 at 0:51 Comment(4)
We'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.Overtask
Looks like a generous contributor has helped to (possibly) eliminate the memory leaks in god. groups.google.com/group/god-rb/browse_thread/thread/…Annals
God memory leak has been fixed about year ago (testing blog.vortorus.net/2009/12/06/…)Distraint
But unfortunately it continues to have trouble stopping and restarting processes.Labanna
S
8

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.

Speculative answered 24/4, 2009 at 18:28 Comment(2)
Can you be more specific? What kind of problems?Faizabad
Sure. $ 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 eventSpeculative
D
6

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).

Doner answered 20/2, 2011 at 1:16 Comment(1)
I 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.Unsung
B
4

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

Bandy answered 1/9, 2010 at 20:47 Comment(3)
these reasons were exactly why i'm switching to godElias
@Elias 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!Department
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 :)Elias

© 2022 - 2024 — McMap. All rights reserved.