Skip to content

Instantly share code, notes, and snippets.

@dstrelau
Created November 10, 2011 22:26
Show Gist options
  • Save dstrelau/1356462 to your computer and use it in GitHub Desktop.
Save dstrelau/1356462 to your computer and use it in GitHub Desktop.
watching unicorns with upstart
# turn off marking upstreams as failed via max_fails and fail_timeout
# if you're only using 1 unicorn, you have to list it twice so nginx tries it again
upstream app {
server 127.0.0.1:8080 max_fails=0 fail_timeout=0;
server 127.0.0.1:8080 max_fails=0 fail_timeout=0;
}
# tells nginx to retry another upstream on failure
proxy_next_upstream error;
proxy_pass http://app;
# LIMIT AS = VIRT in top
# For some reason, LIMIT RSS doesn't work correctly
limit as 157286400 157286400 # 150*1024*1024
exec /usr/local/bin/unicorn -c /home/ubuntu/unicorn.rb /home/ubuntu/config.ru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment