[ds6-devel] Re: nagle algorithm

Chris Leishman chris@leishman.org
Tue Dec 31 09:04:26 2002


On Tuesday, December 31, 2002, at 04:02 AM, Gigi Sullivan wrote:

> Aiee :)
>
>    Hello!

Hello

<snip>
>    I did a few tests and it turned out that we're just a little bit
>    faster disabling Nagle's algorithm when we're sending "lot" of data
>    ("bulk" transfer) at a time, while we're just a little bit slower
>    viceversa (this is just what Nagle is about, tho)
>
>    That said, I don't think the tests are really reliable since I did
>    them on loopback device - so no real network data transfers, just
>    kernel driver software involved (I cannot set up a "real" net 
> connection
>    here, sorry)


Ok....we'll, a few points.  Over the loopback interface, packet 
coalescing is not going to achieve much.  The nagle algorithm will help 
reduce the total number of packets (and increase the size of each 
individual packet), but over the loopback interface this will have 
little benefit since the cost of doing the encapsulation/de-capsulation 
is probably trivial in comparison to the cost of doing the coalescing - 
especially since there is no real data transfer occurring (it's all 
within the kernel space).

This situation is quite different from what it would be over a real 
network, since we also have to add in the cost of transferring 
more&smaller packets v's less&larger packets (with nagle).  Having 
larger packets will result in greater network utilization since the NIC 
has to perform less ethernet encapsulations and create less ethernet 
frames and thus can reduce the number of inter-frame delays.  Larger 
packets will also reduce the total number of memory to device to 
network transfers that the CPU must initiate.

However..... while the nagle algorithm can have these additional 
benefits on wired connections, it may be that in our situation the 
difference between the packet counts&sizes with and without the nagle 
algorithm will be insignificant (a result of reading directly from disk 
and thus always begin able to perform large writes at the application 
layer), and the benefit will not be able to outweigh the cost of doing 
the nagle calculations.

So, in conclusion, we need to do some "real network" testing - or find 
out if someone else already has.  I know for all the applications I've 
done (&tested) it's been better to leave it - but I none of those have 
been disk->network (I've always been reading from an unreliable data 
source).

Regards,
Chris



More information about the ds6-devel mailing list