about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 3f9058e..a8bfa78 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -1,8 +1,15 @@
 # -*- encoding: binary -*-
 require 'kgio'
 require 'unicorn'
-# the value passed to TCP_DEFER_ACCEPT actually matters in Linux 2.6.32+
-Unicorn::SocketHelper::DEFAULTS[:tcp_defer_accept] = 60
+Unicorn::SocketHelper::DEFAULTS.merge!({
+  # the value passed to TCP_DEFER_ACCEPT actually matters in Linux 2.6.32+
+  :tcp_defer_accept => 60,
+
+  # keep-alive performance sucks without this due to
+  # write(headers)-write(body)-read
+  # because we always write headers and bodies with two calls
+  :tcp_nodelay => true,
+})
 
 module Rainbows