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 = "/Users/tom/dev/gravatar2"
8 %w{8200 8201 8202}.each do |port|
10 w.name = "gravatar2-mongrel-#{port}"
11 w.interval = 30.seconds # default
12 w.start = "mongrel_rails start -c #{RAILS_ROOT} -p #{port} \
13 -P #{RAILS_ROOT}/log/mongrel.#{port}.pid -d"
14 w.stop = "mongrel_rails stop -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
15 w.restart = "mongrel_rails restart -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
16 w.start_grace = 10.seconds
17 w.restart_grace = 10.seconds
18 w.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.megabytes
32 c.times = [3, 5] # 3 out of 5 intervals
35 restart.condition(:cpu_usage) do |c|
43 on.condition(:flapping) do |c|
44 c.to_state = [:start, :restart]
47 c.transition = :unmonitored
48 c.retry_in = 10.minutes
50 c.retry_within = 2.hours