Let God help you!
Chiel Wester do 25 feb 10
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 God for help. God is a monitoring tool written in ruby which makes it easy to implement. Simply install god with:
gem install god
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 god homepage) you need to start god and load the config file:
$ god $ god load /path/to/config/file
or shorter:
god -c /path/to/config/file
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 examples folder on GitHub.
In case you want to let god automatically restart your processes after a deploy, you can use the san_juan gem which is a capistrano plugin.

Gepost in hor | 0 reacties
Welkom op Holland On Rails
Het startpunt voor Ruby On Rails in Nederland. Vind de laatste technieken, meningen en nieuwtjes.Recente Jobs
Gezocht: Ruby On Rails ontwikkelaar (junior of senior)
Eet, drink en droom jij over Ruby On Rails? Wil jij het liefste dag en nacht bezig zijn met jehobby; super coole webapplicaties ontwikkelen in Ruby On Rails?
Dan willen wij jou graag een podium bieden om je Ruby skills te vertonen aan onze nationale en internationale klanten!
@ Internetbureau Holder, Obdam
Bekijk alle jobs »»
Gereedschapskist
Onmisbare tools vooriedere developer!
- Ruby On Rails
Framework voor de web 2.0 developer. Eindelijk vooruitgang! - TextMate
Editor for true pro's
Typ, tab, top :-)
Nee, niet voor Win. - Made On A Mac
En nou is het over met die saaie grijze Windows bak van je!
Auteurs op deze site
Chris Obdam
'Less is more' evangelist, past dit ook dagelijks toe op zijn tandenborstel.Chiel Wester
Snelheidswonder op Ruby wielen. Leuk om mee te pair-programmen ;-)
Plaats je reactie