xpra icon
Bug tracker and wiki

Opened 3 years ago

Last modified 3 months ago

#619 assigned enhancement

better TCP_NODELAY handling: only use it when it is useful

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.2
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 (9)

comment:1 Changed 3 years ago by Antoine Martin

Milestone: 0.150.16
Status: newassigned

Re-scheduling.

comment:2 Changed 2 years ago by Antoine Martin

Milestone: 0.160.17

Not enough time, re-scheduling.

comment:3 Changed 20 months ago by Antoine Martin

Milestone: 0.170.18

comment:4 Changed 16 months ago by Antoine Martin

Milestone: 0.181.0

Milestone renamed

comment:5 Changed 14 months ago by Antoine Martin

See also: #1211.

comment:6 Changed 14 months ago by Antoine Martin

Milestone: 1.03.0

comment:7 Changed 8 months ago by Antoine Martin

Milestone: 3.02.1

comment:8 Changed 8 months ago by Antoine Martin

See also #639, #999, #401, #540, #417

comment:9 Changed 3 months ago by Antoine Martin

Milestone: 2.12.2

re-scheduling

Note: See TracTickets for help on using tickets.