Created
July 11, 2012 16:26
-
-
Save blasterpal/3091545 to your computer and use it in GitHub Desktop.
Resque snippits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resque.redis.del 'queue:conversions' | |
Resque.redis.del 'queue:statistics' | |
#Clear all workers from Redis to ensure no worker creep | |
Resque.redis.smembers('workers').each{|w| Resque.redis.srem 'workers',w} | |
#Inspecting error types and histogram of counts: | |
failed_hash = (Resque.redis.lrange :failed, 1,473).collect{|ea| JSON.load ea};p nil | |
histogram = {} | |
failed_hash.each { |item| histogram[item["exception"]] = (histogram[item["exception"]] || 0) +1 };p nil | |
histogram | |
#kill specific working queue, rough command it might take out other forked processes, but it's meant as hammer attack | |
ps -ef | grep resque | egrep -E 'Forked|statistics' | cut -c8-15 | xargs kill -9 | |
#resque process tree | |
ps axjf | egrep -e 'resque.*Forked|resque.*Waiting|resque.*Processing' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment