1 # run with: god start -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"
9 %w{8200 8201 8202}.each do |port|
11 w.name = "gravatar2-mongrel-#{port}"
12 w.interval = 30 # seconds
13 w.start = "mongrel_rails cluster::start --only #{port} \
14 -C #{RAILS_ROOT}/config/mongrel_cluster.yml"
15 w.stop = "mongrel_rails cluster::stop --only #{port} \
16 -C #{RAILS_ROOT}/config/mongrel_cluster.yml"
17 w.grace = 10 # seconds
19 pid_file = File.join(RAILS_ROOT, "log/mongrel.#{port}.pid")
21 w.behavior(:clean_pid_file) do |b|
26 start.condition(:process_not_running) do |c|
27 c.interval = 5 # seconds
32 w.restart_if do |restart|
33 restart.condition(:memory_usage) do |c|
35 c.above = (150 * 1024) # 150mb
36 c.times = [3, 5] # 3 out of 5 intervals
39 restart.condition(:cpu_usage) do |c|
41 c.above = 50 # percent