Xpra: Ticket #2421: detect slow send buffer draining pace using TCP_INFO

See When TCP sockets refuse to die:

An example of checking the draining pace:
while True:
    notsent1 = get_tcp_info(c).tcpi_notsent_bytes
    notsent1_ts = time.time()
    ...
    poll.poll(POLL_PERIOD)
    ...
    notsent2 = get_tcp_info(c).tcpi_notsent_bytes
    notsent2_ts = time.time()
    pace_in_bytes_per_second = (notsent1 - notsent2) / (notsent2_ts - notsent1_ts)
    if pace_in_bytes_per_second > 12000:
        # pace is above effective rate of 96Kbps, ok!
    else:
        # socket is too slow...

Using TCP_INFO.

See also #2420



Sat, 21 Sep 2019 08:29:22 GMT - Antoine Martin: status, description changed


Thu, 24 Oct 2019 12:56:11 GMT - Antoine Martin: summary changed


Thu, 05 Mar 2020 10:32:31 GMT - Antoine Martin: milestone changed

See also ticket:


Sun, 18 Oct 2020 15:31:42 GMT - Antoine Martin:

Based on socket.py (Wrapper module for _socket, providing some additional facilities): r27690 adds TCP_INFO to xpra info.

See also : Congestion detection by observing socket queues.

Next step: figure out how to detect congestion faster using this new data.


Wed, 13 Jan 2021 03:08:42 GMT - Antoine Martin:

See also #3001


Wed, 13 Jan 2021 13:22:48 GMT - Antoine Martin: milestone changed


Sat, 23 Jan 2021 05:50:50 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2421