use TCP_NODELAY on TCP sockets?

Job Snijders job at fastly.com
Wed May 15 19:40:13 CEST 2024


Dear Marco,

On Wed, 15 May 2024 at 19:27, Marco d'Itri <md at linux.it> wrote:

> On May 15, Job Snijders via Bird-users <bird-users at network.cz> wrote:
>
> > But please be very careful in considering this patch, because it does
> > introduce some subtle changes in the on-the-wire behaviour of BIRD. For
> > example, without this patch an UPDATE for a handful of routes and the
> > End-of-RIB marker might end up in the same TCP packet (if this fits);
> > but with this patch, the End-of-RIB marker ends up in its own TCP
> > packet. As things are today, setting TCP_NODELAY will increase the



> I think that this can be fixed easily with TCP_CORK.
> Basically, with TCP_NODELAY + TCP_CORK you can have the optimal balance
> of latency and overhead without using writev.



Yes, thanks for sharing this suggestion.

Note that TCP_CORK is a Linux-only feature (on FreeBSD it seems aliased to
TCP_NOPUSH, but I might be misunderstanding that code). There are subtle
differences between NOPUSH and CORK: resetting CORK triggers a flush,
whereas resetting NOPUSH does not.

It is of course reasonable to optimize one platform and not others, we work
with the tools that we have - but a portable approach (using writev()?)
would seem attractive to me :-)

Kind regards,

Job

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20240515/70e387c2/attachment.htm>


More information about the Bird-users mailing list