celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
596 stars 87 forks source link

Disable Nagle's alrogithm by default. #72

Closed fbernier closed 11 years ago

fbernier commented 11 years ago

For a webserver where requests/responses are usually large enough to be contained in a packet, the Nagle's algorithm slows the last packet sent.

This configuration is probably used in most ruby web servers. I only checked for Puma though.

coveralls commented 11 years ago

Coverage Status

Coverage decreased (-0%) when pulling 11f4b7a922948e43fe71e471f45d2b40cd48257f on fbernier:master into 6732f22d920d45410f0df4af1469f8adac55681a on celluloid:master.

fbernier commented 11 years ago

Looks like it's failing ... be right back.

tarcieri commented 11 years ago

If you can push again (perhaps edit a commit message and force push) it should trigger the build again

coveralls commented 11 years ago

Coverage Status

Coverage increased (+0%) when pulling 24a3fcfafcc357f5a7119570b8a20a92fb83450a on fbernier:master into 6732f22d920d45410f0df4af1469f8adac55681a on celluloid:master.

fbernier commented 11 years ago

:white_check_mark:

tarcieri commented 11 years ago

Seems good, thanks!

digitalextremist commented 11 years ago

I've already been using that in my branch, however I also have these. Ought I push them into a pull request?

socket.setsockopt( Socket::IPPROTO_TCP, :TCP_NODELAY, 1 )
socket.setsockopt( Socket::IPPROTO_TCP, 3, 1 ) # TCP_CORK
socket.setsockopt( Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1 )
tarcieri commented 11 years ago

REUSEADDR would be good. I don't think that usage of TCP_CORK alone will work, though

digitalextremist commented 11 years ago

Ok I will do that. TCP_CORK works with TCP_NODELAY but both or one of them are linux only so I trap by OS.

tarcieri commented 11 years ago

I don't get how TCP_CORK works if you're never uncorking

digitalextremist commented 11 years ago

I believe 3 is UNCORK, I can find the actual man page for this to verify.

tarcieri commented 11 years ago

That doesn't help unless you've corked...