9

我一直在尝试使用sidekiq-limit_fetch gem 限制每个队列的工作人员数量,Sidekiq 似乎“看到”了日志中施加的限制,但是当我观察工作人员时,这些限制被忽略了。

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

2013-04-02T05:47:19Z 748 TID-11ilcw DEBUG: {:queues=>
    ["recommendvariations",
     "recommendvariations",
     "recommendvariations",
     "recommendphenotypes",
     "recommendphenotypes",
     "recommendphenotypes",
     "preparse",
     "preparse",
     "preparse",
     "parse",
     "parse",
     "parse",
     "zipgenotyping",
     "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.yml 。从 sidekiq 的网络界面来看,这些限制被忽略了——现在,我在“recommendvariations”队列中有 2 个工作人员,但应该是 1 个。

我重新开始工人bundle exec sidekiq -e production -C config/sidekiq.yml

有没有其他人遇到过这个?

4

1 回答 1

4

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

像这样:

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

它对我有用。

于 2013-05-15T13:57:45.057 回答