Skip to content

Instantly share code, notes, and snippets.

@igorsokolov
Created June 22, 2010 08:59
Show Gist options
  • Save igorsokolov/448201 to your computer and use it in GitHub Desktop.
Save igorsokolov/448201 to your computer and use it in GitHub Desktop.
Bluepill.application("app", :base_dir => "#{RAILS_ROOT}/tmp/bluepill", :log_file => "#{RAILS_ROOT}/log/bluepill.log") do |app|
app.process("unicorn") do |process|
process.pid_file = File.join(RAILS_ROOT, 'tmp/pids/unicorn.pid')
process.working_dir = RAILS_ROOT
process.start_command = "unicorn -c config/unicorn.rb -E production config.ru"
process.stop_command = "kill -QUIT {{PID}}"
process.restart_command = "kill -USR2 {{PID}}"
process.uid = process.gid = 'www'
process.start_grace_time = 20.seconds
process.stop_grace_time = 20.seconds
process.restart_grace_time = 25.seconds
process.daemonize = true
process.monitor_children do |child_process|
child_process.stop_command = "kill -QUIT {{PID}}"
child_process.checks :mem_usage, :every => 10.seconds, :below => 150.megabytes, :times => [3,4], :fires => :stop
child_process.checks :cpu_usage, :every => 10.seconds, :below => 20, :times => [3,4], :fires => :stop
end
end
end
@akzhan
Copy link

akzhan commented Jun 24, 2010

Я до 30 числа в небольшом отпуске, 1 или 2 июля настрою по вашим конфигам приложение на работе, и поправлю.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment