librelist archives

« back to archive

God and resque worker fail

God and resque worker fail

From:
Carlos Eduardo
Date:
2010-12-09 @ 23:53
Hi,

I'm trying to use god to monitor workers in resque, but something strange is
happening. I'm using the very example that comes with resque.

The god start usually, but not the worker rises, nothing happens.

The redis is functioning normally.

If I run it normally works:

rake resque: work QUEUE =* RAILS_ENV=production /var /www/conv


Now if I put it in god, nothing happens:

God.watch do | w |
  w.name = "resque-convert-a # {}"
  w.interval = 30.seconds
  w.start = rake resque: work QUEUE =* RAILS_ENV = production / var / www /
conv "

and start:

sudo god -c /path/to/monitor.god -D

Or even that below the god also does not charge the worker:

https://github.com/defunkt/resque/blob/master/examples/god/resque.god



Thanks!


Carlos Eduardo

Re: [resque] God and resque worker fail

From:
David Kelso
Date:
2010-12-10 @ 00:03
No idea what's causing it; Try and find some sort of output from a
logfile and paste that for us.
Maybe try setting the directory. Or try explicitly specify the rakefile.
As an extra data point, here's the config that I use:

5.times do |index|
    God.watch do |w|
      w.interval = 30.seconds
      w.start_grace = 30.seconds
      w.restart_grace = 30.seconds
      w.behavior :clean_pid_file
      w.dir = "#{ROOT}"

      w.name     = "resque:work:#{index}"
      w.group    = "resque:workers"
      w.log      = "/var/log/#{w.name}.log"
      w.env      = { "QUEUE" => '*' , "RAILS_ENV" => 'production'}
      w.start    = "bundle exec rake resque:work"
      w.log = "/var/log/god/#{w.name}.log"
  end
end


On Thu, Dec 9, 2010 at 3:53 PM, Carlos Eduardo
<carloseduardo@egenial.com.br> wrote:
>
> Hi,
>
> I'm trying to use god to monitor workers in resque, but something strange is
> happening. I'm using the very example that comes with resque.
>
> The god start usually, but not the worker rises, nothing happens.
>
> The redis is functioning normally.
>
> If I run it normally works:
>
> rake resque: work QUEUE =* RAILS_ENV=production /var /www/conv
>
>
> Now if I put it in god, nothing happens:
>
> God.watch do | w |
>   w.name = "resque-convert-a # {}"
>   w.interval = 30.seconds
>   w.start = rake resque: work QUEUE =* RAILS_ENV = production / var / www /
> conv "
>
> and start:
>
> sudo god -c /path/to/monitor.god -D
>
> Or even that below the god also does not charge the worker:
>
> https://github.com/defunkt/resque/blob/master/examples/god/resque.god
>
>
>
> Thanks!
>
>
> Carlos Eduardo
>

Re: [resque] God and resque worker fail

From:
Carlos Eduardo
Date:
2010-12-10 @ 00:21
Thanks David!

Very good!

 your code worked, I believe this w.dir parameter made the difference.


Thanks!

Carlos Eduardo

2010/12/9 David Kelso <david@kelso.id.au>

> No idea what's causing it; Try and find some sort of output from a
> logfile and paste that for us.
> Maybe try setting the directory. Or try explicitly specify the rakefile.
> As an extra data point, here's the config that I use:
>
> 5.times do |index|
>    God.watch do |w|
>      w.interval = 30.seconds
>      w.start_grace = 30.seconds
>      w.restart_grace = 30.seconds
>      w.behavior :clean_pid_file
>      w.dir = "#{ROOT}"
>
>      w.name     = "resque:work:#{index}"
>      w.group    = "resque:workers"
>      w.log      = "/var/log/#{w.name}.log"
>      w.env      = { "QUEUE" => '*' , "RAILS_ENV" => 'production'}
>      w.start    = "bundle exec rake resque:work"
>      w.log = "/var/log/god/#{w.name}.log"
>  end
> end
>
>
> On Thu, Dec 9, 2010 at 3:53 PM, Carlos Eduardo
> <carloseduardo@egenial.com.br> wrote:
> >
> > Hi,
> >
> > I'm trying to use god to monitor workers in resque, but something strange
> is
> > happening. I'm using the very example that comes with resque.
> >
> > The god start usually, but not the worker rises, nothing happens.
> >
> > The redis is functioning normally.
> >
> > If I run it normally works:
> >
> > rake resque: work QUEUE =* RAILS_ENV=production /var /www/conv
> >
> >
> > Now if I put it in god, nothing happens:
> >
> > God.watch do | w |
> >   w.name = "resque-convert-a # {}"
> >   w.interval = 30.seconds
> >   w.start = rake resque: work QUEUE =* RAILS_ENV = production / var / www
> /
> > conv "
> >
> > and start:
> >
> > sudo god -c /path/to/monitor.god -D
> >
> > Or even that below the god also does not charge the worker:
> >
> > https://github.com/defunkt/resque/blob/master/examples/god/resque.god
> >
> >
> >
> > Thanks!
> >
> >
> > Carlos Eduardo
> >
>

Re: [resque] God and resque worker fail

From:
David Kelso
Date:
2010-12-10 @ 03:33
Great! Glad to help.

On Thu, Dec 9, 2010 at 4:21 PM, Carlos Eduardo
<carloseduardo@egenial.com.br> wrote:
>
> Thanks David!
>
> Very good!
>
>  your code worked, I believe this w.dir parameter made the difference.
>
>
> Thanks!
>
> Carlos Eduardo
>
> 2010/12/9 David Kelso <david@kelso.id.au>
>>
>> No idea what's causing it; Try and find some sort of output from a
>> logfile and paste that for us.
>> Maybe try setting the directory. Or try explicitly specify the rakefile.
>> As an extra data point, here's the config that I use:
>>
>> 5.times do |index|
>>    God.watch do |w|
>>      w.interval = 30.seconds
>>      w.start_grace = 30.seconds
>>      w.restart_grace = 30.seconds
>>      w.behavior :clean_pid_file
>>      w.dir = "#{ROOT}"
>>
>>      w.name     = "resque:work:#{index}"
>>      w.group    = "resque:workers"
>>      w.log      = "/var/log/#{w.name}.log"
>>      w.env      = { "QUEUE" => '*' , "RAILS_ENV" => 'production'}
>>      w.start    = "bundle exec rake resque:work"
>>      w.log = "/var/log/god/#{w.name}.log"
>>  end
>> end
>>
>>
>> On Thu, Dec 9, 2010 at 3:53 PM, Carlos Eduardo
>> <carloseduardo@egenial.com.br> wrote:
>> >
>> > Hi,
>> >
>> > I'm trying to use god to monitor workers in resque, but something
>> > strange is
>> > happening. I'm using the very example that comes with resque.
>> >
>> > The god start usually, but not the worker rises, nothing happens.
>> >
>> > The redis is functioning normally.
>> >
>> > If I run it normally works:
>> >
>> > rake resque: work QUEUE =* RAILS_ENV=production /var /www/conv
>> >
>> >
>> > Now if I put it in god, nothing happens:
>> >
>> > God.watch do | w |
>> >   w.name = "resque-convert-a # {}"
>> >   w.interval = 30.seconds
>> >   w.start = rake resque: work QUEUE =* RAILS_ENV = production / var /
>> > www /
>> > conv "
>> >
>> > and start:
>> >
>> > sudo god -c /path/to/monitor.god -D
>> >
>> > Or even that below the god also does not charge the worker:
>> >
>> > https://github.com/defunkt/resque/blob/master/examples/god/resque.god
>> >
>> >
>> >
>> > Thanks!
>> >
>> >
>> > Carlos Eduardo
>> >
>
>

Re: [resque] God and resque worker fail

From:
Thibaut Barrère
Date:
2011-01-14 @ 17:38
> your code worked, I believe this w.dir parameter made the difference.

One note in case it helps: the w.dir param doesn't work with ruby 1.9
(I had to find a workaround). As well, some people have reported
issues with ruby 1.9 and god, but it works perfectly for me.

-- Thibaut