From 62ebc930c6e3b46cd200212748800c1ca448eb1f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 11 Apr 2009 01:16:35 -0700 Subject: Remove _all_ non-POSIX socket options Unicorn is strictly for fast LAN and localhost clients. Unicorn is not for slow, high-latency or trickling clients and cannot do keepalive or pipelining. None of the removed options actually make sense in the environment Unicorn was designed for. * DEFER_ACCEPT/ACCEPT_FILTER - these are useful for mitigating connect() floods or trickling clients. We shouldn't have to deal with those on a trusted LAN. * TCP_CORK/TCP_NODELAY - we only send output in the response and then immediately close the socket. Assuming the typical response containing a small header and large strings in the body: the Nagle algorithm would've corked the headers regardless and any pending output would be immediately flushed when the socket is closed immediately after sending. These options would still be useful from the client-side on the LAN, or if Unicorn supported keepalive. Of course, I highly recommend enabling all of these options you can possibly enable on nginx or another fully-buffering reverse proxy when dealing with slow clients. --- lib/unicorn.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index fd66529..4e82ec6 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -404,7 +404,6 @@ module Unicorn # in 3 easy steps: read request, call app, write app response def process_client(client) client.nonblock = false - set_client_sockopt(client) if TCPSocket === client env = @request.read(client) app_response = @app.call(env) HttpResponse.write(client, app_response) -- cgit v1.2.3-24-ge0c7