From ce5868855c7bbd0aa82dcd60b2e27a3fd3d5f9fb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 5 Feb 2009 02:34:27 -0800 Subject: Disable userspace buffering on client sockets It's really pointless to allow stdio or something similar to do any sort of buffering on a TCP socket on a Linux box where syscalls are cheap and we have TCP_CORK. --- lib/unicorn.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index b4721be..57471a4 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -196,7 +196,8 @@ module Unicorn while alive begin client = @socket.accept - + client.sync = true + if defined?($tcp_cork_opts) and $tcp_cork_opts client.setsockopt(*$tcp_cork_opts) rescue nil end -- cgit v1.2.3-24-ge0c7