diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-06 12:39:36 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-06 14:39:40 -0700 |
commit | a96e19063d5154b87676fa435ca174f545465ec2 (patch) | |
tree | 79dbd053f02d3d7c946df710d70e6a69bf82feaa /lib/unicorn/configurator.rb | |
parent | 3673d07250f35e88c9b57ec429a75e5a68f7ca7b (diff) | |
download | unicorn-a96e19063d5154b87676fa435ca174f545465ec2.tar.gz |
The defaults should be reasonable, but there may be folks who want to experiment. (cherry picked from commit 686281a90a9b47bac4dfd32a72a97e6e8d26afa1)
Diffstat (limited to 'lib/unicorn/configurator.rb')
-rw-r--r-- | lib/unicorn/configurator.rb | 35 |
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 |