-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Set keepalive on TCP socket so idleTimeout works #3740
Conversation
The build failed, but the reason of failure doesn't seem to be related with the introduced changes. What is the procedure in such cases ?
|
The real problem:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
This is a really good fix! Thank you
But I think it should be better to do it here
https://github.com/containous/traefik/blob/bb331285522b2734fc36b5cde0c9c5170c4ffcfe/server/server.go#L558
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this PR @ajardan
LGTM 👏 👏 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
This makes traefik set KeepAlive on TCP connections it accepts, which fixes #3263 and possibly other issues related to socket leak, or file descriptor exhaustion.
Without this change, the configuration option
has no effect, since it only works for keep-alive connections according to this document:
https://golang.org/src/net/http/server.go?s=93090:93158#L2443
Motivation
This is a relatively trivial change that improves how traefik performs and increases its performance and stability.
More
Additional Notes
I am not actually the author of this code, it is taken from the net.http.Server package, original source here:
https://golang.org/src/net/http/server.go?s=93090:93158#L3207