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

added keepalive for dynomite listen connection #692

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

TysonHeart
Copy link

Issue #691 Enabled keepalive for listen connection of dynomite.

@balajivenki
Copy link
Contributor

@shailesh33 and @ipapapa Can you please review this PR for the ticket #691

@smukil
Copy link
Contributor

smukil commented Aug 2, 2019

@balajivenki Thanks for the contribution. I will have a look at it shortly.

@balajivenki
Copy link
Contributor

@shailesh33 and @ipapapa Can you please review the changes? It will help us if it gets merged in the future releases.

@ipapapa ipapapa requested a review from smukil August 17, 2019 13:48
@smukil
Copy link
Contributor

smukil commented Aug 19, 2019

@balajivenki @TysonHeart The code looks good to me and is doing the right thing. One additional thing I would note is whether you want to add an option for TCP_KEEPINTVL. The default on most linux kernels for the interval between 2 keep alive probes is 7200 seconds (2 hours), which I think is a fair interval for the purpose of recycling connections for our use cases. Setting the interval too less can add a lot of load to the server, especially when you're dealing with 50k+ connections, and leaving it too large can leave a lot of un-recycled connections.

If you'd like to add a configurable option for TCP_KEEPINTVL for your use cases, feel free to submit another patch. But this can go in as is for now. Thanks for the contribution again.

https://man7.org/linux/man-pages/man7/tcp.7.html
tcp_keepalive_time` (integer; default: 7200; since Linux 2.2)
The number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes. Keep-alives are sent only when the SO_KEEPALIVE socket option is enabled. The default value is 7200 seconds (2 hours). An idle connection is terminated after approximately an additional 11 minutes (9 probes an interval of 75 seconds apart) when keep-alive is enabled.

@balajivenki
Copy link
Contributor

@smukil Thanks for merging this. We thought of making it as configurable and decided to honor the values in sysctl.conf

net.ipv4.tcp_keepalive_time
net.ipv4.tcp_keepalive_intvl
net.ipv4.tcp_keepalive_probes

And we have changed our sysctl.conf to our ideal values. That way there is no confusion and all conf's related to tcp keepalive are at the same place.

@murthy-chelankuri
Copy link

Can we merge this change to our latest stable version as well v0.7.0 may be as v0.7.1? We are also facing a similar issue in our prod environment

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

Successfully merging this pull request may close these issues.

4 participants