Remove _all_ non-POSIX socket options
commit62ebc930c6e3b46cd200212748800c1ca448eb1f
authorEric Wong <normalperson@yhbt.net>
Sat, 11 Apr 2009 08:16:35 +0000 (11 01:16 -0700)
committerEric Wong <normalperson@yhbt.net>
Sat, 11 Apr 2009 08:26:41 +0000 (11 01:26 -0700)
treefd5c888c33ac58544121c1cfb3e59b584d01e51a
parent3e9fe197d4daac14fa98addfcf9be3208c7b96b8
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
lib/unicorn/socket.rb