about summary refs log tree commit homepage
path: root/lib/unicorn
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-06 12:39:36 -0700
committerEric Wong <normalperson@yhbt.net>2010-07-06 12:48:41 -0700
commit686281a90a9b47bac4dfd32a72a97e6e8d26afa1 (patch)
treebd1bccb172e5fdd384e39da4447bca091f915a32 /lib/unicorn
parentef8f888ba1bacc759156f7336d39ba9b947e3f9d (diff)
downloadunicorn-686281a90a9b47bac4dfd32a72a97e6e8d26afa1.tar.gz
The defaults should be reasonable, but there may be
folks who want to experiment.
Diffstat (limited to 'lib/unicorn')
-rw-r--r--lib/unicorn/configurator.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 533e0ed..3cf0d72 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -273,6 +273,41 @@ module Unicorn
     # This has no effect on TCP listeners.
     #
     # Default: 0 (world read/writable)
+    #
+    # +:tcp_defer_accept:+ defer accept() until data is ready (Linux-only)
+    #
+    # For Linux 2.6.32 and later, this is the number of retransmits to
+    # defer an accept() for if no data arrives, but the client will
+    # eventually be accepted after the specified number of retransmits
+    # regardless of whether data is ready.
+    #
+    # For Linux before 2.6.32, this is a boolean option, and
+    # accepts are _always_ deferred indefinitely if no data arrives.
+    # This is similar to <code>:accept_filter => "dataready"</code>
+    # under FreeBSD.
+    #
+    # Specifying +true+ is synonymous for the default value(s) below,
+    # and +false+ or +nil+ is synonymous for a value of zero.
+    #
+    # A value of +1+ is a good optimization for local networks
+    # and trusted clients.  For Rainbows! and Zbatery users, a higher
+    # value (e.g. +60+) provides more protection against some
+    # denial-of-service attacks.  There is no good reason to ever
+    # disable this with a +zero+ value when serving HTTP.
+    #
+    # Default: 1 retransmit for \Unicorn, 60 for Rainbows! 0.95.0\+
+    #
+    # +:accept_filter: defer accept() until data is ready (FreeBSD-only)
+    #
+    # This enables either the "dataready" or (default) "httpready"
+    # accept() filter under FreeBSD.  This is intended as an
+    # optimization to reduce context switches with common GET/HEAD
+    # requests.  For Rainbows! and Zbatery users, this provides
+    # some protection against certain denial-of-service attacks, too.
+    #
+    # There is no good reason to change from the default.
+    #
+    # Default: "httpready"
     def listen(address, opt = {})
       address = expand_addr(address)
       if String === address