Ruby-on-rails 上帝与蒙尼特

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/768184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 21:09:53  来源:igfitidea点击:

God vs. Monit

ruby-on-railsrubymonitoringmonitgod

提问by Milan Novota

Which one to use for process monitoring and why?

使用哪一种进行过程监控?为什么?

采纳答案by Oleg Shaldybin

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

God 配置文件是用 Ruby 编写的,所以基本上你可以做 Ruby 允许你做的所有事情,而且还有很多东西。Monit 必须使用自己的语法进行配置,这通常没问题,但限制更多。无论如何,您还可以使用 Ruby 生成 monit 配置(作为部署策略的一部分)。

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.

此外,monit 使用的资源较少,因此如果您使用 VPS 或只是没有任何备用内存,monit 可能是更好的选择。就个人而言,我更喜欢上帝,因为它更具可配置性。

Here's a very good screencast on god. There's also a lot of feedback in comments to this screencast.

这是关于上帝的一个非常好的截屏视频。对此截屏视频的评论中也有很多反馈。

回答by nitecoder

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.

上帝的内存泄漏非常严重,所以我为我的 VPS 选择了 Monit。Monit 始终以大约 2MB 的 RAM 运行,而我在 Ruby 1.8.6 上运行的上帝安装在大约 36 小时内泄漏到大约 60MB 的 RAM。我不想监控我的系统监控工具,所以我放弃了 God 并转到 Monit 并且完全没有问题。

回答by Brad Gessler

God has a lot of problems including:

上帝有很多问题,包括:

  1. It leaks memory
  2. It has trouble stopping and restarting processes
  1. 它泄漏内存
  2. 它无法停止和重新启动进程

I did a write-up about it at http://blog.bradgessler.com/use-monit-with-rails-not-god

我在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.

monit 唯一真正的问题(如果它有问题)是如果您正在运行大型集群,配置文件可能会变得有点冗长,但这可以通过模板系统解决。

回答by Bob Aman

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.

甚至让 God 在我的专用 Ubuntu 服务器上运行,我也遇到了很多问题。我最终只好放弃。Monit 可能不是 Ruby,但它基本上没有麻烦。

回答by wuputah

To anyone finding this post going forward, you might also consider bluepillas 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).

对于任何发现这篇文章的人,您也可以将bluepill视为上帝的替代品。虽然我希望上帝在过去两年中解决了它的内存问题,但我知道 bluepill 从一开始就以很小的足迹运行。虽然仍然不如 monit 小,但 bluepill 的占用空间非常合理(对我来说大约 16 MB VIRT,13 MB RES)。

回答by dsummersl

Monit has its own issues:

Monit 有其自身的问题:

  • 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.
  • 空的 PID 文件会导致问题。
  • 如果您有多个级别的依赖项,它会在启动较低级别的依赖项时启动顶级应用程序。这对于某些用例来说可能很好,但它不是特别灵活。

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

目前我觉得这很烦人。幸运的是,您可以通过它们的“组”功能轻松浏览依赖项,但这并不是特别令人满意。无论如何,这就是我对 v5.1.1 的看法