-
Notifications
You must be signed in to change notification settings - Fork 228
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
TCP_INFO support #362
Comments
This would be a nice addition. I think we should use same strategy we do for Mio's event: https://github.com/tokio-rs/mio/blob/1f8cd972f7a575e097c29da1e5aa2d4b7f399d8d/src/event/event.rs. That is define a |
Thank you for thinking about my request. Merely being able to log TCP_INFO before closing a TCP stream would be an awesome improvement on what happens today. Being able to poll it frequently, would allow for a rust application to better rate limit itself. I look at these frameworks, and my mind crashes, but it is indeed, just one system call, or auxiliary data that can be pulled from a tcp request. The way that google measurement labs does it though, is different, in that they just log the whole binary tcp_info struct as one record, and figure out how to parse it later - from the kernel, the order of the fields is garunteed to be stable, but every new linux kernel release has added more data to that struct. So despite that innate desire to provide accessor functions you appear to have, just getting that whole structure from point a to point b, somehow, is helpful. Somewhat related, recently a rather large microservices user, realized that 80% of the data they were sending to the web server never made it to the users, they applied the TCP_NOTSENT_LOWAT option (I think, 32k) to a huge improvement in overall service time. This document might provide some insight as to who that was (it led to the apache traffic server patch) |
I'm not sure if you're implying that socket2 should log anything, but we're not going to do that. We can add a nice getter and setter function to the |
I am interested in implementing this interface, but I have a question for which I haven't come up with a good solution: the struct |
I don't want to maintain a struct definition, this will have to live in the libc crate.
For the type in socket2 we can define something like Lines 401 to 552 in b39fdc6
|
Ok, then I think this feature might be blocked since libc haven't implemented this struct libc/#1609 for linux. I will see if there is an opportunity to implement |
the windows v2 tcp_info header is better, as it has more of the variables I (at least) care about. Thx, all for looking into it. |
TCP_INFO (struct tcp_info) contains metrics for how the tcp layer is performing, and lends insight into what is otherwise a black box for most folk. Notable are base rtt, rtt, loss, retries, ecn_seen from my perceptual worrying-about-bufferbloat perspective...
Windows impl:
https://learn.microsoft.com/en-us/windows/win32/api/mstcpip/ns-mstcpip-tcp_info_v1
Apache traffic server's implementation: https://docs.trafficserver.apache.org/en/9.0.x/admin-guide/plugins/tcpinfo.en.html
How google measurement labs uses it: https://www.measurementlab.net/tests/tcp-info/ (out of band in this case)
It would be really nice to be able to monitor this set of metrics for more applications.
The text was updated successfully, but these errors were encountered: