From 7c125886b5862bf20711bae22e6697ad46141434 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 25 Oct 2013 19:27:05 +0000 Subject: support SO_REUSEPORT on new listeners (:reuseport) This allows users to start an independent instance of unicorn on a the same port as a running unicorn (as long as both instances use :reuseport). ref: https://lwn.net/Articles/542629/ --- lib/unicorn/configurator.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/unicorn/configurator.rb') diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 0d0eac7..fc3405a 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -319,6 +319,25 @@ class Unicorn::Configurator # # Default: Operating-system dependent # + # [:reuseport => true or false] + # + # This enables multiple, independently-started unicorn instances to + # bind to the same port (as long as all the processes enable this). + # + # This option must be used when unicorn first binds the listen socket. + # It cannot be enabled when a socket is inherited via SIGUSR2 + # (but it will remain on if inherited), and it cannot be enabled + # directly via SIGHUP. + # + # Note: there is a chance of connections being dropped if + # one of the unicorn instances is stopped while using this. + # + # This is supported on *BSD systems and Linux 3.9 or later. + # + # ref: https://lwn.net/Articles/542629/ + # + # Default: false (unset) + # # [:tries => Integer] # # Times to retry binding a socket if it is already in use -- cgit v1.2.3-24-ge0c7