Rails的Resque改变工人的限制? [英] Rails Resque change worker limit?
问题描述
我有一些Resque工人Rails应用程序。看来,我同时运行(应用程序在EC2上运行的Apache在生产中)2工人的限制。有没有什么办法可以提高这一限制?
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?
编辑:
我在redis.conf的MaxClients 0
I have maxclients 0 in redis.conf
我可以通过耙启动10个工人,但他们实际上得到排队,我得到ERR客户的最大数目达到了浏览器..
I can start 10 workers through rake, but when they are actually getting queued, I get "ERR max number of clients reached" in browser..
编辑:更新错误(它是在原来的文件是正确的)
updated mistake (it was correct in original file)
编辑:其实是有配置/初始化/ Resque.rb指向的Redis到去(来自应用程序的早期雏形),一旦我删除,指向配置/ resque.yml(与本地主机)一切进展正常,好像我我可以开始为许多工人。
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.
推荐答案
也许你的问题更是一个系统管理员之一,但如果没有一个系统资源问题,那么这可能会有帮助。
从 http://railscasts.com/episodes/271-resque?view=asciicast
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
使用resque宝石,只要使用这个rake任务
Using the resque gem, just use this rake task
#/lib/tasks/resque.rake
require "resque/tasks"
task "resque:setup" => :environment
和根据需要启动尽可能多的resque工人。
and start up as many resque workers as you need.
$ rake resque:work QUEUE='*'
最好用一些服务监控框架,SVC,monit的,神。并使用resque网页。
best use some service monitoring framework, svc, monit, god. and use resque web.
这篇关于Rails的Resque改变工人的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!