1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Disable Nageling on TCP clients

Nageling, due to the nature of keep-alive connections, slows them down
considerably, especially on Linux. On Linux, a 500ms delay is introduced
when sending back the last packet of a response over a persistent
connection.

This option was tested on OS X and showed minimal effect to performance.
This commit is contained in:
Evan Phoenix 2011-11-30 15:50:44 -08:00
parent d0a2fac2ac
commit 8d0515e2c8

View file

@ -126,6 +126,10 @@ module Puma
end
def process_client(client)
if client.kind_of? TCPSocket
client.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
end
begin
while true
parser = HttpParser.new