gpt4 book ai didi

ruby-on-rails - Sidekiq 无缘无故被杀

转载 作者:行者123 更新时间:2023-12-04 19:31:03 27 4
gpt4 key购买 nike

我在使用 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

我在 Centos 6.5 上的 Digital Ocean 上运行此服务器,带有 512MB RAM,Rails4 应用程序。
我猜这个问题可能与我缺乏 RAM 有关。
谁能建议我如何解决这个问题?
  • 附加说明,如果我访问 Sidekiq 仪表板, worker 甚至不会进入“忙碌”状态,它只会消失,而不是“失败”或“已处理”

  • 先感谢您!

    最佳答案

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

    关于ruby-on-rails - Sidekiq 无缘无故被杀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23801259/

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