Multiple resque workers mode creating extra processes

后端 未结 1 1353
梦如初夏
梦如初夏 2021-02-09 15:47

I need to start 4 resque workers so i used following command

bundle exec rake environment resque:workers RAILS_ENV=production COUNT=4 QUEUE=* VERBOSE=1 PIDFILE=         


        
1条回答
  •  北荒
    北荒 (楼主)
    2021-02-09 16:11

    You don't want to use the COUNT=n option in production, as it runs each worker in a thread instead of a separate process - which is much less stable.

    Official Resque docs:

    Running Multiple Workers
    
    At GitHub we use god to start and stop multiple workers. A sample god configuration file is included under examples/god. We recommend this method.
    
    If you'd like to run multiple workers in development mode, you can do so using the resque:workers rake task:
    
    $ COUNT=5 QUEUE=* rake resque:workers
    This will spawn five Resque workers, each in its own process. Hitting ctrl-c should be sufficient to stop them all.
    

    Here's the example God monitoring/configuration file that ships with Resque to run multiple processes, and here's an example for monit.

    0 讨论(0)
提交回复
热议问题