<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,67 +1,72 @@
 RAILS_ROOT = &quot;/var/www/apps/blogpub/current&quot;
 
-God.watch do |w|
-  w.name     = &quot;blogpub-mongrel-#{port}&quot;
-  w.interval = 30.seconds # default
-  w.start    = &quot;mongrel_rails cluster::start&quot;
-  w.stop     = &quot;mongrel_rails cluster::stop&quot;
-  w.restart  = &quot;mongrel_rails cluster::restart&quot;
+%w{9000 9001 9002}.each do |port|
+  God.watch do |w|
+    w.name     = &quot;blogpub-mongrel-#{port}&quot;
+    w.interval = 30.seconds # default
+    w.start    = &quot;mongrel_rails start -e production -c #{RAILS_ROOT} -p #{port} -P #{RAILS_ROOT}/tmp/pids/mongrel.#{port}.pid -d&quot;
+    w.stop     = &quot;mongrel_rails stop -P #{RAILS_ROOT}/tmp/pids/mongrel.#{port}.pid&quot;
+    w.restart  = &quot;mongrel_rails restart -P #{RAILS_ROOT}/tmp/pids/mongrel.#{port}.pid&quot;
+    
+    w.start_grace   = 10.seconds
+    w.restart_grace = 10.seconds
   
-  # clean pid files before start if necessary; here you have to give it 
-  # the pid files for all the mongrels in the cluster
-  # w.pid_file = File.join(RAILS_ROOT, &quot;tmp/pids/mongrel.#{port}.pid&quot;)
-  # w.behavior(:clean_pid_file)
+    # clean pid files before start if necessary; here you have to give it 
+    # the pid files for all the mongrels in the cluster
+    w.pid_file = File.join(RAILS_ROOT, &quot;tmp/pids/mongrel.#{port}.pid&quot;)
+    w.behavior(:clean_pid_file)
 
-  # determine the state on startup
-  w.transition(:init, { true =&gt; :up, false =&gt; :start }) do |on|
-    on.condition(:process_running) do |c|
-      c.running = true
+    # determine the state on startup
+    w.transition(:init, { true =&gt; :up, false =&gt; :start }) do |on|
+      on.condition(:process_running) do |c|
+        c.running = true
+      end
     end
-  end
 
-  # determine when process has finished starting
-  w.transition([:start, :restart], :up) do |on|
-    on.condition(:process_running) do |c|
-      c.running = true
-    end
+    # determine when process has finished starting
+    w.transition([:start, :restart], :up) do |on|
+      on.condition(:process_running) do |c|
+        c.running = true
+      end
   
-    # failsafe
-    on.condition(:tries) do |c|
-      c.times = 5
-      c.transition = :start
+      # failsafe
+      on.condition(:tries) do |c|
+        c.times = 5
+        c.transition = :start
+      end
     end
-  end
 
-  # start if process is not running
-  w.transition(:up, :start) do |on|
-    on.condition(:process_exits)
-  end
-
-  # restart if memory or cpu is too high
-  w.transition(:up, :restart) do |on|
-    on.condition(:memory_usage) do |c|
-      c.interval = 30
-      c.above = 60.megabytes
-      c.times = [3, 5]
+    # start if process is not running
+    w.transition(:up, :start) do |on|
+      on.condition(:process_exits)
     end
+
+    # restart if memory or cpu is too high
+    w.transition(:up, :restart) do |on|
+      on.condition(:memory_usage) do |c|
+        c.interval = 30
+        c.above = 65.megabytes
+        c.times = [3, 5]
+      end
   
-    on.condition(:cpu_usage) do |c|
-      c.interval = 30
-      c.above = 10.percent
-      c.times = [3, 5]
+      on.condition(:cpu_usage) do |c|
+        c.interval = 30
+        c.above = 20.percent
+        c.times = [3, 5]
+      end
     end
-  end
 
-  # lifecycle
-  w.lifecycle do |on|
-    on.condition(:flapping) do |c|
-      c.to_state = [:start, :restart]
-      c.times = 5
-      c.within = 5.minute
-      c.transition = :unmonitored
-      c.retry_in = 10.minutes
-      c.retry_times = 5
-      c.retry_within = 2.hours
+    # lifecycle
+    w.lifecycle do |on|
+      on.condition(:flapping) do |c|
+        c.to_state = [:start, :restart]
+        c.times = 5
+        c.within = 5.minute
+        c.transition = :unmonitored
+        c.retry_in = 10.minutes
+        c.retry_times = 5
+        c.retry_within = 2.hours
+      end
     end
   end
 end
\ No newline at end of file</diff>
      <filename>god/boot.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>73d531a135c8e6c1d1434b15b0578fc38d4bcbd0</id>
    </parent>
  </parents>
  <author>
    <name>sergiu truta</name>
    <email>sergiutruta@gmail.com</email>
  </author>
  <url>http://github.com/sergiutruta/blogpub/commit/19e5a8b428f6081a39392065b3a2d4785659a1e1</url>
  <id>19e5a8b428f6081a39392065b3a2d4785659a1e1</id>
  <committed-date>2008-03-22T06:17:11-07:00</committed-date>
  <authored-date>2008-03-22T06:17:11-07:00</authored-date>
  <message>updated god configuration file</message>
  <tree>38d1fb591bfee51337345190f558888f8df660d4</tree>
  <committer>
    <name>sergiu truta</name>
    <email>sergiutruta@gmail.com</email>
  </committer>
</commit>
