-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/tcp: provide a way to set keepalive time and interval separately #8328
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
Comments
CL https://golang.org/cl/136480043 mentions this issue. |
IMHO it would be useful to support, in a platform indipendent way, the configuration of all keep-alive settings:
An attempt has been made by @felixge with his tcpkeepalive library For Windows inspiration can be taken from the work performed to close https://github.com/dotnet/corefx/issues/25040 and https://github.com/dotnet/corefx/issues/33111 |
Bumping this issue. Having the ability to set custom keep-alive settings would be a huge benefit to folks who write TCP Server applications (folks like myself). At the moment, there is no way to set the idle time (tcp_keepalive_time) or probe count (tcp_keepalive_probes) via the standard library implementation. These settings can be set at a per session value, and are very useful when dealing with long live TCP Sessions. At the moment you either need to use the tcpkeepalive library which in its own admission has issues or export the raw connection to set these values with syscall. |
Indeed looks like a bug to me why is timeout=interval that totally does not make any sense. We receive usually every minute a request from our iot devices so we would like to set the timeout to more than a minute. This way we dont flood the network with keep alives. If we do not receive something for 1 minute connetion is timed out after 10 (keep alive count) x interval = 30 seconds. With the GO implementation: The only option i have is to either set it to 3 seconds. Flodding the network with unneeded keep alive messages or set it to 1 minute and aceppting that a connections takes 9 minutes to time out! This is not acceptable. If we have 50.000 IOT devices connected and there is a network break it takes 9 mintues to clean up the mess, But every 3 seconds an ACK request is with this number of devices hugh increase in traffic over a year. |
by redforks:
The text was updated successfully, but these errors were encountered: