Bluepill + Resque

Skip to first unread message


Mar 23, 2011, 12:50:30 AM3/23/11
to Bluepill
I've seen some examples around the net about pill scripts for resque,
but none work to my satisfaction. My issue is with the child
processes..for some reason I get zombie workers lying around and I'm
having trouble killing them. God offers a script called stale for
killing these, but I find that it kills more than it's supposed to. I
may start to hack a solution using their solution without killing off
resque_web which I monitor too but I was hoping there was a more sane

Here is my resque.pill script:

I tried using -QUIT instead of -USR1 as well and that didn't seem to
work either. Bluepill actually gets the right pid when I check the
status using rvmsudo bluepill my_app_resque_web status, but I think
it's not actually running the stop_command for the child processes,
because when I run -QUIT on those processes, they die gracefully.

Any ideas/help?


Mar 23, 2011, 1:40:10 AM3/23/11
to Bluepill
On further review of the process class, it seems that the stop_process
method does not run the child stop_command. Any work going on in this
arena? ATM, monitor_children + stop_command does not work as
advertised. :-/

Blake Watters

Mar 23, 2011, 9:00:38 AM3/23/11
to, lancecarlson
Funny enough, yesterday morning I set up a Bluepill configuration for Resque that I am deploying to production today. I decided to use Resque-Pool so that I can get Copy-on-Write for my workers and save memory. My configuration is pretty simple:

# Resque Pool
  app.process "resque-pool" do |process|
    process.pid_file = pid_path("resque-pool")
    process.start_command = "resque-pool -E #{rails_env} -o #{rails_root}/log/resque-pool.log -e #{rails_root}/log/resque-pool.log"
    process.stop_command = "kill -TERM {{PID}}"
    process.daemonize = true
    process.start_grace_time = 45.seconds
    process.restart_grace_time = 45.seconds
Blake Watters
Two Toasters | CTO
Reply all
Reply to author
0 new messages