【发布时间】:2018-02-14 16:26:03
【问题描述】:
所以我的应用点击了一个特色页面,现在我在 heroku 上的后台工作人员 dyno 获得了大量点击,这是我以前从未经历过的......我的队列已经爆炸了!在排队的作业和正在执行的作业之间需要 20 多分钟。如何缩放它以使其变为秒而不是分钟?
/sidekiq.yml
# Configuration file for Sidekiq.
# Options here can still be overridden by cmd line args.
# Place this file at config/sidekiq.yml and Sidekiq will
# pick it up automatically.
# :logfile: ./log/sidekiq.log
:concurrency: 2
:timeout: 8
过程文件
...
worker: bundle exec sidekiq -q default -q mailers
【问题讨论】:
-
只运行更多sidekiq dynos。在同一个测功机上放置更多线程最终会使其过载。
-
我的 dynos 从 1 个增加到 4 个,但没有任何改善
-
好吧,试试 40 看看。 heroku 按秒计费,20 分钟的实验不会花你太多钱
-
我不知道redis是否会允许那么多worker一次从队列中拉出来......我现在就试试
-
很快得到“错误:心跳:ERR 最大客户端数”。那是因为我的 Redis 只允许 10 个连接吗?我猜是的
标签: ruby-on-rails heroku sidekiq