How do I clear stuck/stale Resque workers?

后端 未结 15 762
你的背包
你的背包 2020-12-07 07:22

As you can see from the attached image, I\'ve got a couple of workers that seem to be stuck. Those processes shouldn\'t take longer than a couple of seconds.

15条回答
  •  感情败类
    2020-12-07 07:41

    I've cleared them out from redis-cli directly. Luckily redistogo.com allows access from environments outside heroku. Get dead worker ID from the list. Mine was

    55ba6f3b-9287-4f81-987a-4e8ae7f51210:2
    

    Run this command in redis directly.

    del "resque:worker:55ba6f3b-9287-4f81-987a-4e8ae7f51210:2:*"
    

    You can monitor redis db to see what it's doing behind the scenes.

    redis xxx.redistogo.com> MONITOR
    OK
    1380274567.540613 "MONITOR"
    1380274568.345198 "incrby" "resque:stat:processed" "1"
    1380274568.346898 "incrby" "resque:stat:processed:c65c8e2b-555a-4a57-aaa6-477b27d6452d:2:*" "1"
    1380274568.346920 "del" "resque:worker:c65c8e2b-555a-4a57-aaa6-477b27d6452d:2:*"
    1380274568.348803 "smembers" "resque:queues"
    

    Second last line deletes the worker.

提交回复
热议问题