Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewland committed May 19, 2008
1 parent c9cb962 commit 8f46bd1
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion Readme.textile
Expand Up @@ -9,7 +9,14 @@ h2. Requirements

h2. Install

@sudo gem install jnewland-god_web -s http://gems.github.com@
<code>
<pre>
git clone git://github.com/jnewland/god_web.git
cd god_web
gem build god_web.gemspec
sudo gem install -l god_web-*.gem
</pre>
</code>

h2. Usage

Expand All @@ -29,6 +36,50 @@ Then provide that yaml file as the first argument to god_web:

@sudo god_web /path/to/god_web.yml -p PORT_TO_RUN_ON -e production@

You might want to monitor god_web to make sure it stays up:

<code>
<pre>
God.watch do |w|
w.name = "god_web"
w.interval = 1.minute
w.start = "sudo god_web -e prodction -p 8888"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds

w.start_if do |start|
start.condition(:process_running) do |c|
c.running = false
end
end

w.restart_if do |restart|
restart.condition(:memory_usage) do |c|
c.above = 20.megabytes
c.times = [3, 5]
end

restart.condition(:cpu_usage) do |c|
c.above = 25.percent
c.times = 5
end
end

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
</pre>
</code>

h3. Author

"Jesse Newland":http://jnewland.com/
Expand Down

0 comments on commit 8f46bd1

Please sign in to comment.