Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect slow send buffer draining pace using TCP_INFO #2421

Open
totaam opened this issue Sep 21, 2019 · 4 comments
Open

detect slow send buffer draining pace using TCP_INFO #2421

totaam opened this issue Sep 21, 2019 · 4 comments
Labels
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Sep 21, 2019

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

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2020

@totaam
Copy link
Collaborator Author

totaam commented Oct 18, 2020

Based on How to get amount of non-ACK-ed TCP data for the socket?, Is it possible to read the number of bytes buffered for a TCP write socket? and 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.

@totaam
Copy link
Collaborator Author

totaam commented Jan 13, 2021

See also #3001

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2022

Excellent read from cloudflare: Optimizing TCP for high WAN throughput while preserving low latency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant