多重Resque Worker模式创建额外的进程

问题描述 投票:6回答:1

我需要启动4个resque worker,所以我使用了以下命令

bundle exec rake environment resque:workers RAILS_ENV=production COUNT=4 QUEUE=* VERBOSE=1 PIDFILE=tmp/pids/resque_worker.pid  >> log/resque_worker_QUEUE.log 

但是进入Web界面,实际上是在启动8位工作人员。有两个父进程,每个父进程有4个子进程。以下是进程的树视图:

红宝石/code_base/bundle/ruby/1.9.1/bin/rake环境resque:workers RAILS_ENV = production COUNT = 4 QUEUE = * VERBOSE = 1 PIDFILE = tmp / pids / resque_worker.pid\ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*\ _ [红宝石]红宝石/code_base/bundle/ruby/1.9.1/bin/rake环境resque:workers RAILS_ENV = production COUNT = 4 QUEUE = * VERBOSE = 1 PIDFILE = tmp / pids / resque_worker.pid\ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*| \ _ [红宝石]\ _ resque-1.15.0:等待*\ _ [红宝石]

无法确定是什么导致额外的过程开始?

resque
1个回答
13
投票

您不希望在生产环境中使用COUNT = n选项,因为它在线程中运行每个工作线程,而不是在单独的进程中运行-这很不稳定。

© www.soinside.com 2019 - 2024. All rights reserved.