gpt4 book ai didi

ruby-on-rails-3 - Monit Ruby on Rails Sidekiq

转载 作者:行者123 更新时间:2023-12-04 13:52:23 24 4
gpt4 key购买 nike

我正在尝试为Sidekiq设置Monit。到目前为止,这是我的配置文件:

 check process sidekiq_site
with pidfile /var/www/site/tmp/pids/sidekiq.pid
start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds
if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
group site_sidekiq

问题是我在运行monit reload时收到一条消息,提示程序“bundle”不存在。

有人对此有解决方案吗?

最佳答案

在完成自己的monit和sidekiq配置后,我可以共享对我运行ubuntu有用的内容。

首先,如果您在发行版上,则存在一个针对ubuntu的sidekiq Upstart 脚本。有用于sidekiq和管理 worker 的脚本:https://github.com/mperham/sidekiq/tree/master/examples/upstart/manage-one

我在使用rvm时,使用默认的 Upstart 脚本遇到了一些错误。检查/var/logs/upstart/sidekiq-0.log可以发现一些问题。
这行:
exec bin/sidekiq -i ${index} -e production -C config/sidekiq.yml -P tmp/pids/sidekiq-${index}.pid
需要更改为exec bundle exec sidekiq +选项

然后,为了使所有内容都与我的rvm安装保持一致,我更改了以下内容:

#source $HOME/.rvm/scripts/rvm
source /usr/local/rvm/scripts/rvm

在/etc/monit/monitrc中,我引用了 Upstart 脚本,并具有:
# sidekiq
check process sidekiq
with pidfile /var/www/apps/myapp/current/tmp/pids/sidekiq-0.pid
start program = "/usr/bin/sudo start sidekiq index=0"
stop program = "/usr/bin/sudo stop sidekiq index=0"
if totalmem is greater than 500 MB for 2 cycles then restart # eating up memory?
if 3 restarts within 5 cycles then timeout

关于ruby-on-rails-3 - Monit Ruby on Rails Sidekiq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13433866/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com