From a96e19063d5154b87676fa435ca174f545465ec2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 6 Jul 2010 12:39:36 -0700 Subject: configurator: documentation for new accept options The defaults should be reasonable, but there may be folks who want to experiment. (cherry picked from commit 686281a90a9b47bac4dfd32a72a97e6e8d26afa1) --- lib/unicorn/configurator.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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 :accept_filter => "dataready" + # 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 -- cgit v1.2.3-24-ge0c7