1 # run with: god -c /path/to/gravatar.god
3 # This is the actual config file used to keep the mongrels of
4 # gravatar.com running.
6 RAILS_ROOT = "/var/www/gravatar2/current"
8 %w{8200 8201 8202}.each do |port|
10 w.name = "gravatar2-mongrel-#{port}"
11 w.interval = 30 # seconds
12 w.start = "mongrel_rails cluster::start --only #{port} \
13 -C #{RAILS_ROOT}/config/mongrel_cluster.yml"
14 w.stop = "mongrel_rails cluster::stop --only #{port} \
15 -C #{RAILS_ROOT}/config/mongrel_cluster.yml"
16 w.grace = 10 # seconds
18 pid_file = File.join(RAILS_ROOT, "log/mongrel.#{port}.pid")
20 w.behavior(:clean_pid_file)
23 start.condition(:process_running) do |c|
24 c.interval = 5 # seconds
29 w.restart_if do |restart|
30 restart.condition(:memory_usage) do |c|
31 c.above = (150 * 1024) # 150mb
32 c.times = [3, 5] # 3 out of 5 intervals
35 restart.condition(:cpu_usage) do |c|
36 c.above = 50 # percent