ruby-on-rails – 限制Sidekiq中每个队列的工作量

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 限制Sidekiq中每个队列的工作量前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直试图使用 sidekiq-limit_fetch gem来限制每个队列的工作量,而Sidekiq似乎“看到”日志中强加的限制,但是当我看到工作人员时,忽略了限制.

这是Sidekiq看到限制的日志中的部分:

2013-04-02T05:47:19Z 748 TID-11ilcw DEBUG: {:queues=>
    ["recommendvariations","recommendvariations","recommendphenotypes","preparse","parse","zipgenotyping","zipfulldata","deletegenotype","fitbit","frequency","genomegov","mailnewgenotype","mendeley_details","mendeley","pgp","plos_details","plos","snpedia","fixphenotypes"],:concurrency=>5,:require=>".",:environment=>"production",:timeout=>8,:profile=>false,:verbose=>true,:pidfile=>"/tmp/sidekiq.pid",:logfile=>"./log/sidekiq.log",:limits=>
    {"recommendvariations"=>1,"recommendphenotypes"=>1,"preparse"=>2,"parse"=>2,"zipgenotyping"=>1,"zipfulldata"=>1,"fitbit"=>3,"frequency"=>10,"genomegov"=>1,"mailnewgenotype"=>1,"mendeley_details"=>1,"mendeley"=>1,"pgp"=>1,"plos_details"=>1,"plos"=>1,"snpedia"=>1,"fixphenotypes"=>1},:strict=>false,:config_file=>"config/sidekiq.yml",:tag=>"snpr"}

从sidekiq的网络界面来看,这些限制被忽略了 – 现在,我有2名工作人员在“推荐变化” – 但是应该是1.

我通过bundle exec sidekiq -e production-config / sidekiq.yml启动工作.

有没有人见过这个?

解决方法

您是否尝试在sidekiq.rb初始化程序文件中设置限制?

像这样:

Sidekiq::Queue['recommend'].limit = 1

它对我有用.

猜你在找的Ruby相关文章