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

Introduce extended Keep-Alive options #1437

Closed
mp911de opened this issue Sep 30, 2020 · 4 comments
Closed

Introduce extended Keep-Alive options #1437

mp911de opened this issue Sep 30, 2020 · 4 comments
Labels
type: feature A new feature
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Sep 30, 2020

Feature Request

We should support extended Keep-Alive configuration (enabled, idle, interval, count) for more fine-grained control of keep-alive.

Is your feature request related to a problem? Please describe

Detection of dead peers, see #1428.

Describe the solution you'd like

Applying Keep-Alive channel options automatically.

Describe alternatives you've considered

Manual configuration, see #1428 (comment) and #1428 (comment).

@mp911de
Copy link
Collaborator Author

mp911de commented Nov 30, 2020

ExtendedSocketOptions.TCP_KEEPIDLE was introduced with Java 11.

@mp911de mp911de added this to the 6.1 M1 milestone Nov 30, 2020
mp911de added a commit that referenced this issue Nov 30, 2020
Lettuce now supports extended Keep-Alive options when using io_uring, epoll, or NIO. Extended NIO socket options are available on Java 11 or newer.

Also, refactor channel/EventLoopGroup initialization into a single place available from Transports.configureBootstrap.
@mp911de mp911de closed this as completed Nov 30, 2020
@yangbodong22011
Copy link
Contributor

@mp911de hello, I noticed DEFAULT_INTERVAL = 1, code see here.

But according to Linux kernel default parameter, it should be 75:

net.ipv4.tcp_keepalive_time=7200
net.ipv4.tcp_keepalive_intvl=75
net.ipv4.tcp_keepalive_probes=9

Not sure if it is reasonable to discuss this issue under the closed issue, if need to open a new issue, let me know.

@mp911de
Copy link
Collaborator Author

mp911de commented Mar 17, 2021

I'm not sure about the defaults. These seem to be different across platforms. It think it's fine to update the interval to 75. Feel free to submit a pull request.

@yangbodong22011
Copy link
Contributor

thanks, i will submit a PR.

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

No branches or pull requests

2 participants