Skip to content

Instantly share code, notes, and snippets.

@peterdavidhamilton
Forked from arya/production.pill
Created November 17, 2010 16:23
Show Gist options
  • Save peterdavidhamilton/703591 to your computer and use it in GitHub Desktop.
Save peterdavidhamilton/703591 to your computer and use it in GitHub Desktop.
bluepill config example
env_vars = "RAILS_ENV=production PATH=/sb/thehierarchy/ruby/bin:/sb/thehierarchye/nginx/sbin:$PATH RUBY_HEAP_MIN_SLOTS=500000 RUBY_HEAP_SLOTS_INCREMENT=250000 RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 RUBY_GC_MALLOC_LIMIT=50000000"
RAILS_ROOT = "/var/www/apps/thehierarchy/current/"
Bluepill.application("thehierarchy") do |app|
app.process("scheduled_notifications") do |process|
process.group = "thehierarchy"
process.pid_file = File.join(RAILS_ROOT, "tmp", "pids", "scheduled_notifications")
process.daemonize = true
process.start_command = "/usr/bin/env #{env_vars} rake --rakefile=#{RAILS_ROOT}/Rakefile app_name:scheduled_notifications"
process.checks :mem_usage, :every => 10.seconds, :below => 150.megabytes, :times => [5,7]
process.checks :cpu_usage, :every => 10.seconds, :below => 10, :times => [9,10]
process.checks :flapping, :times => 5, :within => 1.minute, :retry_in => 10.minutes
end
app.process("background_worker") do |process|
process.group = "thehierarchy"
process.pid_file = File.join(RAILS_ROOT, "tmp", "pids", "background_worker")
process.daemonize = true
process.start_command = "/usr/bin/env #{env_vars} rake --rakefile=#{RAILS_ROOT}/Rakefile thehierarchy:background_worker"
process.checks :mem_usage, :every => 10.seconds, :below => 150.megabytes, :times => [5,7]
process.checks :cpu_usage, :every => 10.seconds, :below => 10, :times => [9,10]
process.checks :flapping, :times => 5, :within => 1.minute, :retry_in => 10.minutes
end
end
@neohunter
Copy link

why we need to use /usr/bin/env ?

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