xpra icon
Bug tracker and wiki

Opened 6 years ago

Last modified 8 months ago

#619 closed enhancement

better TCP_NODELAY handling: only use it when it is useful — at Initial Version

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: critical Milestone: 2.3
Component: core Version: 0.12.x
Keywords: Cc:

Description

Follow up from #514: at present we enable TCP_NODELAY globally which is a bit wasteful.

It ensures that packets go out as soon as we queue them, but when the packets contain large-ish binary data this means that the binary data and the actual xpra packet structure are likely to travel in separate TCP-level packets.

It would be better to only enable TCP_NODELAY when aggregating packets is not helping: when we have no more data to send or when the output buffer is full. As per: Is there a way to flush a POSIX socket? and this answer:
What I do is enable Nagle, write as many bytes (using non-blocking I/O) as I can to the socket (i.e. until I run out of bytes to send, or the send() call returns EWOULDBLOCK, whichever comes first), and then disable Nagle again. This seems to work well (i.e. I get low latency AND full-size packets where possible)

Change History (0)

Note: See TracTickets for help on using tickets.