Skip to content

Instantly share code, notes, and snippets.

@imbriaco
Created January 4, 2010 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save imbriaco/268223 to your computer and use it in GitHub Desktop.
Save imbriaco/268223 to your computer and use it in GitHub Desktop.
Bluepill.application("app_name") do |app|
app.process("app_name") do |process|
process.start_command = "cd /u/apps/app_name/current && /usr/local/bin/unicorn_rails -c /u/apps/app_name/current/config/unicorn.conf.rb -E production -D"
process.stop_command = "kill -QUIT `cat /u/apps/app_name/current/tmp/pids/unicorn.pid`"
process.restart = "kill -USR2 `cat /u/apps/app_name/current/tmp/pids/unicorn.pid`"
process.stdout = process.stderr = "/u/apps/app_name/current/log/unicorn.log"
process.pid_file = "/u/apps/app_name/current/tmp/pids/unicorn.pid"
process.checks :mem_usage, :every => 10.seconds, :below => 250.megabytes, :times => [3, 5]
process.uid = "app"
process.gid = "app"
process.start_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
process.checks :flapping, :times => 2, :within => 30.seconds, :retry_in => 7.seconds
process.monitor_children do |cp|
cp.checks :mem_usage, :every => 10, :below => 250.megabytes, :times => [3, 5]
process.checks :cpu_usage, :every => 10.seconds, :below => 50, :times => 5
cp.stop_command = "kill -QUIT {{PID}}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment