[nsd-users] NSD TCP performance

Colm MacCarthaigh colm at stdlib.net
Fri Nov 9 03:46:39 UTC 2007


On Thu, Nov 08, 2007 at 06:30:56PM -0800, Aaron Hopkins wrote:
> On Thu, 8 Nov 2007, nsd at dclg.ca wrote:
> 
> > NSD always sends the two byte response size as a separate TCP packet
> > (causing the requestor to send a separate ACK) to the main body of the
> > request.
> 
> I reported this in May 2006.  Found in nsd-3.0.6/doc/TODO:
> 
> - From Aaron Hopkins: write tcp length and tcp data in one write operation,
>    instead of multiple calls to write. Avoids Nagle algo delay in this case.
>    preallocate 2 bytes in front of buffer to put them into.
> 
> There are a few other performance-related things I reported at the same time
> still in the TODO that you might be interested in.

A quick and simple, not very portable, fix in the meantime might be to use the
TCP_CORK/TCP_NOPUSH socket option (depending on platform) on the socket. 

-- 
Colm MacCárthaigh                        Public Key: colm+pgp at stdlib.net



More information about the nsd-users mailing list