-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
reverseproxy: Adjust defaults, document defaults #4436
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Related to some of the issues in #4245, a complaint about the proxy transport defaults not being properly documented in https://caddy.community/t/default-values-for-directives/14254/6. - Dug into the stdlib to find the actual defaults for some of the timeouts and buffer limits, documenting them in godoc so the JSON docs get them next release. - Moved the keep-alive and dial-timeout defaults from `reverseproxy.go` to `httptransport.go`. It doesn't make sense to set defaults in the proxy, because then any time the transport is configured with non-defaults, the keep-alive and dial-timeout defaults are lost! - Sped up the dial timeout from 10s to 3s, in practice it rarely makes sense to wait a whole 10s for dialing. A shorter timeout helps a lot with the load balancer retries, so using something lower helps with user experience.
francislavoie
added
bug 🐞
Something isn't working
under review 🧐
Review is pending before merging
documentation 📚
Improvements or additions to documentation
labels
Nov 24, 2021
francislavoie
force-pushed
the
proxy-defaults
branch
from
November 24, 2021 02:29
c1859a1
to
e24ad1f
Compare
francislavoie
added a commit
to caddyserver/website
that referenced
this pull request
Nov 24, 2021
Pairs with caddyserver/caddy#4436. I could split these changes in two, some changes should only land in 2.5.0, but others are pure documentation that could be pushed live now. But 🤷♂️ I think it's fine for these to wait until 2.5.0, what's another month or whatever? 😅
mholt
approved these changes
Nov 24, 2021
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.
These are all great changes. I had been wanting to get around to taking better care of defaults, so thank you!
mholt
pushed a commit
to caddyserver/website
that referenced
this pull request
Dec 2, 2021
) Pairs with caddyserver/caddy#4436. I could split these changes in two, some changes should only land in 2.5.0, but others are pure documentation that could be pushed live now. But 🤷♂️ I think it's fine for these to wait until 2.5.0, what's another month or whatever? 😅
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to some of the issues in #4245, a complaint about the proxy transport defaults not being properly documented in https://caddy.community/t/default-values-for-directives/14254/6.
Dug into the stdlib to find the actual defaults for some of the timeouts and buffer limits, documenting them in godoc so the JSON docs get them next release.
Moved the keep-alive and dial-timeout defaults from
reverseproxy.go
tohttptransport.go
. It doesn't make sense to set defaults in the proxy, because then any time the transport is configured with non-defaults, the keep-alive and dial-timeout defaults are lost!Sped up the dial timeout from 10s to 3s, in practice it rarely makes sense to wait a whole 10s for dialing. A shorter timeout helps a lot with the load balancer retries, so using something lower helps with user experience.
Also set a dial timeout for the
fastcgi
transport, it didn't have one at all. Might as well.Made the keep-alive interval (
ProbeInterval
) configurable via Caddyfile. This was an oversight, I guess.