【问题标题】:Sidekiq got killed for no reasonSidekiq 无缘无故被杀
【发布时间】:2014-05-24 07:37:41
【问题描述】:

我在使用 Sidekiq 时遇到问题,当 Worker 启动时,进程被杀死。

[deploy@server svr]$ bundle exec sidekiq -e production
2014-05-22T07:49:33Z 4043 TID-18mgoy INFO: Running in ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
2014-05-22T07:49:33Z 4043 TID-18mgoy INFO: See LICENSE and the LGPL-3.0 for licensing details.
2014-05-22T07:49:33Z 4043 TID-18mgoy INFO: Starting processing, hit Ctrl-C to stop
2014-05-22T07:49:33Z 4043 TID-1sux8k INFO: Booting Sidekiq 3.0.0 with redis options {}

然后我将运行一个进程,从我的 Rails 应用程序中触发工作人员

2014-05-22T07:49:59Z 4043 TID-1e780u S3Worker JID-8c862be58af968fa8b84aedf INFO: start
2014-05-22T07:49:59Z 4043 TID-1e3ye4 S3Worker JID-79c585fbd3c7000a5a6fbf95 INFO: start
2014-05-22T07:49:59Z 4043 TID-1e1i6k S3Worker JID-d62d41b13f2dd4849d4cc887 INFO: start
Killed
[deploy@server svr]$

这是我的 Worker 代码,Worker 的目的是从远程位置将图像上传到 S3。

class S3Worker
   include Sidekiq::Worker

   def perform(id, url)
      @image = Image.new(post_id: id)
      @image.remote_image_url = url

      if @image.save
         logger.info "Image Uploaded to S3"
      end
   end
end

我在 Digital Ocean 上使用 512MB RAM 和 Rails4 应用程序在 Centos 6.5 上运行此服务器。 我猜这个问题可能与我缺乏 RAM 有关。 谁能建议我如何解决这个问题?

  • 附加说明,如果我访问 Sidekiq Dashboard,Worker 甚至都不会进入“忙碌”状态,它只会消失,而不是“失败”或“已处理”

提前谢谢你!

【问题讨论】:

    标签: ruby-on-rails centos sidekiq digital-ocean


    【解决方案1】:

    是的,您需要更多 RAM。尝试使用-c 5 来减少 Sidekiq 的内存使用量。

    【讨论】:

    • 感谢您的建议,我尝试将线程减少到5个,但我的服务器似乎最多只能支持3个。将尽快升级我的服务器RAM
    猜你喜欢
    • 1970-01-01
    • 2023-02-11
    • 1970-01-01
    • 1970-01-01
    • 2020-08-17
    • 2011-07-18
    • 1970-01-01
    • 1970-01-01
    • 2018-02-15
    相关资源
    最近更新 更多