Rails Resque change worker limit?

前提是你 提交于 2019-12-12 05:27:10

问题


I have Rails app with some Resque workers. It seems that I have a limit of 2 workers running simultaneously (app runs on EC2 with Apache in production). Is there any way I can raise that limit?

EDIT:

I have maxclients 0 in redis.conf

I can start 10 workers through rake, but when they are actually getting queued, I get "ERR max number of clients reached" in browser..

EDIT: updated mistake (it was correct in original file)

EDIT: actually had config/initializers/Resque.rb pointing to redis-to-go (was rudiment from the early days of app), once I removed that, pointing to config/resque.yml (with localhost) everything went to normal and I can start as many workers as I please.


回答1:


maybe your question is more of a sysadmin one, but if not a system resource issue, then this may help. from http://railscasts.com/episodes/271-resque?view=asciicast

Using the resque gem, just use this rake task

#/lib/tasks/resque.rake 
require "resque/tasks"

task "resque:setup" => :environment

and start up as many resque workers as you need.

$ rake resque:work QUEUE='*'

best use some service monitoring framework, svc, monit, god. and use resque web.



来源:https://stackoverflow.com/questions/10859250/rails-resque-change-worker-limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!