joyent/node — Issue #2296: windows: http throughput optimization with connection:close requests
Author: igorzi
Created: 2011-12-08 20:03:52+00:00
State: open
Labels: http, performance, windows

On Windows, the processing of connection:close requests could be optimized to not queue any more reads after the request has been read in full. This will save a syscall and will cause less completion packets from IOCP. The resulting win in throughput has been measured to be around 3%.

## Details:

### Current implementaiton:

When we dequeue `WSARecv` packet from IOCP, we fire the read-callback to node. After node handles the read-callback, we queue another 0-read (another` WSARecv` call) to be notified when there's more data to read. Eventually we close the connection after writing the response, which will cause the WSARecv packet to be dequeued from IOCP (which is ignored).

### Proposed fix:

Implement a new API in libuv that node would call after reading the connection:close request in full. The API would give a hint to libuv to not queue any more reads from the connection.