From 9ee68c1bd57d72e8a969f1da492bd51bfa5ed9a0 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 24 Nov 2021 01:32:25 -0500 Subject: reverseproxy: Adjust defaults, document defaults (#4436) * reverseproxy: Adjust defaults, document defaults Related to some of the issues in https://github.com/caddyserver/caddy/issues/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. * reverseproxy: Make keepalive interval configurable via Caddyfile * fastcgi: DialTimeout default for fastcgi transport too --- caddytest/integration/caddyfile_adapt/reverse_proxy_options.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'caddytest/integration') diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_options.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_options.txt index 544bb9f..70e7af6 100644 --- a/caddytest/integration/caddyfile_adapt/reverse_proxy_options.txt +++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_options.txt @@ -22,6 +22,7 @@ https://example.com { compression off max_conns_per_host 5 keepalive_idle_conns_per_host 2 + keepalive_interval 30s } } } @@ -80,7 +81,8 @@ https://example.com { "dial_timeout": 3000000000, "expect_continue_timeout": 9000000000, "keep_alive": { - "max_idle_conns_per_host": 2 + "max_idle_conns_per_host": 2, + "probe_interval": 30000000000 }, "max_conns_per_host": 5, "max_response_header_size": 30000000, -- cgit v1.2.3