Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Use socket.setNoDelay( true ) on sockets #99

Open
FabianEmmes opened this issue Apr 21, 2016 · 0 comments
Open

Use socket.setNoDelay( true ) on sockets #99

FabianEmmes opened this issue Apr 21, 2016 · 0 comments

Comments

@FabianEmmes
Copy link

Under some circumstances, nodejs HTTP Replies are delayed (by about 40ms on Linux) uneededly by Nagle's Algorithm. It would probably be better to solve this upstream, i.e., in the connect server.

The following is a fix, but depends on #94. It can easily be backported though.

      // Depending on the request, connect/nodejs write the http header and
      // body separately. Set TCP_NODELAY to avoid delays in such situations.
      middlewares.push( function( req, res, next ) {
         req.socket.setNoDelay( true );
         next();
      } );
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants