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

reverseproxy: Adjust defaults, document defaults #4436

Merged
merged 3 commits into from Nov 24, 2021
Merged

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented Nov 24, 2021

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.

  • 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.

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 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 francislavoie added this to the v2.5.0 milestone Nov 24, 2021
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? 😅
Copy link
Member

@mholt mholt left a 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!

@francislavoie francislavoie merged commit 9ee68c1 into master Nov 24, 2021
@francislavoie francislavoie deleted the proxy-defaults branch November 24, 2021 06:32
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? 😅
@mholt mholt removed the under review 🧐 Review is pending before merging label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working documentation 📚 Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants