0.0
No commit activity in last 3 years
No release in over 3 years
Balances queues by allotted time, prevents 1 queue from starving all others.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.26.0
 Project Readme

Balances queues by usage time, to prevent high priority queues from starving all others.

Install

gem install resque-balancer

require 'resque-balancer' in your Rakefile

Usage

# high can use 50x the time low uses and 2.5x the time medium uses
# by default all queues get the same usage allowance
export BALANCER_WEIGHTS=high:5,medium:2,low:0.1

# clear usage counts every X seconds to make queues that were super busy in the past get a fresh start
# by default this will happen every 10 minutes
export BALANCER_RESET_INTERVAL=60

rake resque:work

Known issues

  • flooding a queue with long running jobs will make all workers process 1 of them, leading to potential short starvation of other queues

Alternatives

  • resque-crowd_control a bit more complicated, does congestion control based on custom attributes accross all workers

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status