From b1d8d3de991ebc5b7d655f2e8a1294129021db8a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 13 Jun 2011 22:17:14 +0000 Subject: change TCP defaults to favor low latency These TCP settings are a closer match to the behavior of Unix domain sockets and what users expect for fast streaming responses even if nginx can't provide them just now... --- lib/unicorn/configurator.rb | 8 +++++--- lib/unicorn/socket_helper.rb | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 0b84d53..bdb77ec 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -264,8 +264,9 @@ class Unicorn::Configurator # # This has no effect on UNIX sockets. # - # Default: +false+ (Nagle's algorithm enabled) in \Unicorn, - # +true+ in Rainbows! + # Default: +true+ (Nagle's algorithm disabled) in \Unicorn, + # +true+ in Rainbows! This defaulted to +false+ in \Unicorn + # 3.x # # [:tcp_nopush => true or false] # @@ -279,7 +280,8 @@ class Unicorn::Configurator # # This has no effect on UNIX sockets. # - # Default: +true+ in \Unicorn 3.4+, +false+ in Rainbows! + # Default: +false+ + # This defaulted to +true+ in \Unicorn 3.4 - 3.7 # # [:ipv6only => true or false] # diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb index 8548276..3519a7b 100644 --- a/lib/unicorn/socket_helper.rb +++ b/lib/unicorn/socket_helper.rb @@ -27,9 +27,9 @@ module Unicorn # same default value as Mongrel :backlog => 1024, - # since we don't do keepalive, we'll always flush-on-close and - # this saves packets for everyone. - :tcp_nopush => true, + # favor latency over bandwidth savings + :tcp_nopush => false, + :tcp_nodelay => true, } #:startdoc: -- cgit v1.2.3-24-ge0c7