God vs. Monit for process monitoring

Ruby on-RailsRubyMonitoringMonitGod

Ruby on-Rails Problem Overview


Which one to use for process monitoring and why?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

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.

Solution 2 - Ruby on-Rails

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.

Solution 3 - Ruby on-Rails

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][1]

[1]: http://blog.bradgessler.com/use-monit-with-rails-not-god "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.

Solution 4 - Ruby on-Rails

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.

Solution 5 - Ruby on-Rails

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

Solution 6 - Ruby on-Rails

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMilan NovotaView Question on Stackoverflow
Solution 1 - Ruby on-RailsnitecoderView Answer on Stackoverflow
Solution 2 - Ruby on-RailsOleg ShaldybinView Answer on Stackoverflow
Solution 3 - Ruby on-RailsBrad GesslerView Answer on Stackoverflow
Solution 4 - Ruby on-RailsBob AmanView Answer on Stackoverflow
Solution 5 - Ruby on-RailswuputahView Answer on Stackoverflow
Solution 6 - Ruby on-RailsdsummerslView Answer on Stackoverflow