[nsd-users] NSD TCP performance

W.C.A. Wijngaards wouter at NLnetLabs.nl
Fri Nov 9 08:02:43 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Colm MacCarthaigh wrote:
> 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. 

Yes, this is what NSD does. Simple code.

TCP performance is not considered important, as it should rarely be used
with DNS. UDP performance is the goal. Therefore the (otherwise
excellent) patches from Aaron did not get applied, they introduce extra
code, portability attention, where it is not needed.

The non-blocking patch is (in some form) in NSD now, Aaron, because that
fixed some race-conditions for secondary zones.

Best regards,
   Wouter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHNBQjkDLqNwOhpPgRAv3nAJoCF0XWzzbhxVimUF1ARs2r134kRgCgsju7
DHfYB3LuXrjUv159maTmuTI=
=o0oy
-----END PGP SIGNATURE-----



More information about the nsd-users mailing list