From bbeecaa06049a7e9a063a754c8a58765a692f521 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 9 Oct 2009 15:06:44 -0700 Subject: configurator: update with nginx fail_timeout=0 example It has come to our attention that this setting is not very well-known to the rest of the world... --- lib/unicorn/configurator.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 77a55ad..c7afece 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -175,6 +175,23 @@ module Unicorn # to the scheduling limitations by the worker process. Due the # low-complexity, low-overhead implementation, timeouts of less # than 3.0 seconds can be considered inaccurate and unsafe. + # + # For running Unicorn behind nginx, it is recommended to set + # "fail_timeout=0" for in your nginx configuration like this + # to have nginx always retry backends that may have had workers + # SIGKILL-ed due to timeouts. + # + # # See http://wiki.nginx.org/NginxHttpUpstreamModule for more details + # # on nginx upstream configuration: + # upstream unicorn_backend { + # # for UNIX domain socket setups: + # server unix:/path/to/unicorn.sock fail_timeout=0; + # + # # for TCP setups + # server 192.168.0.7:8080 fail_timeout=0; + # server 192.168.0.8:8080 fail_timeout=0; + # server 192.168.0.9:8080 fail_timeout=0; + # } def timeout(seconds) Numeric === seconds or raise ArgumentError, "not numeric: timeout=#{seconds.inspect}" -- cgit v1.2.3-24-ge0c7