<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Let God help you!</title>
    <link>http://hollandonrails.nl/articles/479-Let-God-help-you-</link>
    <description>Yesterday i posted about implementing Resque. With Resque you can easily implement background jobs and put them in a queue. After that, you can start some resque workers to do perform all the enqueued jobs.

Obviously there is a need to make sure that all your workers are running and when they go down (for any reason at all) you should be notified about it, and you want the workers to restart automatically.

In this case you can ask &quot;God for help&quot;:http://god.rubyforge.org/. God is a monitoring tool written in ruby which makes it easy to implement. Simply install god with:

&lt;code&gt;
gem install god
&lt;/code&gt;

The config files of god (in the config files you define the processes god needs to watch for you) are written entirely in ruby. After configuring your watches (see example on the &quot;god homepage&quot;:http://god.rubyforge.org/) you need to start god and load the config file:

&lt;code&gt;
$ god
$ god load /path/to/config/file
&lt;/code&gt;

or shorter:

&lt;code&gt;
god -c /path/to/config/file
&lt;/code&gt;

After that, you can ask god for the status of the processes it is watching (god status) and also restart processes (god restart name_of_group)

Resque ships with a predefined god configuration that can be found in the &quot;examples folder on GitHub&quot;:http://github.com/defunkt/resque/tree/master/examples/god/.

In case you want to let god automatically restart your processes after a deploy, you can use the &quot;san_juan gem&quot;:http://github.com/jnewland/san_juan which is a capistrano plugin.

!http://healmenow.files.wordpress.com/2008/03/iloveyoumorethananything.jpg!</description>
  </channel>
</rss>
