You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "masaori335 (via GitHub)" <gi...@apache.org> on 2025/07/28 04:53:13 UTC
[PR] Connect Retry with Exponential Backoff [trafficserver]
masaori335 opened a new pull request, #12397:
URL: https://github.com/apache/trafficserver/pull/12397
When connect attempt to the origin server is failed, ATS retries immediately. In some case, this pile up connections to the origin servers and hard to make it back. This change introduce a new config to do exponential backoff on retry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on code in PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397#discussion_r2234694064
##########
src/api/InkAPITest.cc:
##########
@@ -8679,37 +8679,38 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.http.transaction_no_activity_timeout_out", "proxy.config.http.transaction_active_timeout_out",
"proxy.config.http.connect_attempts_max_retries", "proxy.config.http.connect_attempts_max_retries_down_server",
"proxy.config.http.connect_attempts_rr_retries", "proxy.config.http.connect_attempts_timeout",
- "proxy.config.http.down_server.cache_time", "proxy.config.http.doc_in_cache_skip_dns",
- "proxy.config.http.background_fill_active_timeout", "proxy.config.http.response_server_str",
- "proxy.config.http.cache.heuristic_lm_factor", "proxy.config.http.background_fill_completed_threshold",
- "proxy.config.net.sock_packet_mark_out", "proxy.config.net.sock_packet_tos_out",
- "proxy.config.http.insert_age_in_response", "proxy.config.http.chunking.size",
- "proxy.config.http.flow_control.enabled", "proxy.config.http.flow_control.low_water",
- "proxy.config.http.flow_control.high_water", "proxy.config.http.cache.range.lookup",
- "proxy.config.http.default_buffer_size", "proxy.config.http.default_buffer_water_mark",
- "proxy.config.http.request_header_max_size", "proxy.config.http.response_header_max_size",
- "proxy.config.http.negative_revalidating_enabled", "proxy.config.http.negative_revalidating_lifetime",
- "proxy.config.http.negative_revalidating_list", "proxy.config.ssl.hsts_max_age",
- "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time",
- "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write",
- "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header",
- "proxy.config.http.auth_server_session_private", "proxy.config.http.slow.log.threshold",
- "proxy.config.http.cache.generation", "proxy.config.body_factory.template_base",
- "proxy.config.http.cache.open_write_fail_action", "proxy.config.http.number_of_redirections",
- "proxy.config.http.cache.max_open_write_retries", "proxy.config.http.cache.max_open_write_retry_timeout",
- "proxy.config.http.redirect_use_orig_cache_key", "proxy.config.http.attach_server_session_to_client",
- "proxy.config.websocket.no_activity_timeout", "proxy.config.websocket.active_timeout",
- "proxy.config.http.uncacheable_requests_bypass_parent", "proxy.config.http.parent_proxy.total_connect_attempts",
- "proxy.config.http.transaction_active_timeout_in", "proxy.config.srv_enabled",
- "proxy.config.http.forward_connect_method", "proxy.config.ssl.client.cert.filename",
- "proxy.config.ssl.client.cert.path", "proxy.config.http.parent_proxy.mark_down_hostdb",
- "proxy.config.http.cache.ignore_accept_mismatch", "proxy.config.http.cache.ignore_accept_language_mismatch",
- "proxy.config.http.cache.ignore_accept_encoding_mismatch", "proxy.config.http.cache.ignore_accept_charset_mismatch",
- "proxy.config.http.parent_proxy.fail_threshold", "proxy.config.http.parent_proxy.retry_time",
- "proxy.config.http.parent_proxy.per_parent_connect_attempts", "proxy.config.http.normalize_ae",
- "proxy.config.http.insert_forwarded", "proxy.config.http.proxy_protocol_out",
- "proxy.config.http.allow_multi_range", "proxy.config.http.request_buffer_enabled",
- "proxy.config.http.allow_half_open", ConnectionTracker::CONFIG_SERVER_VAR_MIN,
+ "proxy.config.http.connect_attempts_retry_backoff_base", "proxy.config.http.down_server.cache_time",
Review Comment:
This line is the main change. https://github.com/apache/trafficserver/pull/12396 will reduce changed lines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 merged PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on code in PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397#discussion_r2234694064
##########
src/api/InkAPITest.cc:
##########
@@ -8679,37 +8679,38 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.http.transaction_no_activity_timeout_out", "proxy.config.http.transaction_active_timeout_out",
"proxy.config.http.connect_attempts_max_retries", "proxy.config.http.connect_attempts_max_retries_down_server",
"proxy.config.http.connect_attempts_rr_retries", "proxy.config.http.connect_attempts_timeout",
- "proxy.config.http.down_server.cache_time", "proxy.config.http.doc_in_cache_skip_dns",
- "proxy.config.http.background_fill_active_timeout", "proxy.config.http.response_server_str",
- "proxy.config.http.cache.heuristic_lm_factor", "proxy.config.http.background_fill_completed_threshold",
- "proxy.config.net.sock_packet_mark_out", "proxy.config.net.sock_packet_tos_out",
- "proxy.config.http.insert_age_in_response", "proxy.config.http.chunking.size",
- "proxy.config.http.flow_control.enabled", "proxy.config.http.flow_control.low_water",
- "proxy.config.http.flow_control.high_water", "proxy.config.http.cache.range.lookup",
- "proxy.config.http.default_buffer_size", "proxy.config.http.default_buffer_water_mark",
- "proxy.config.http.request_header_max_size", "proxy.config.http.response_header_max_size",
- "proxy.config.http.negative_revalidating_enabled", "proxy.config.http.negative_revalidating_lifetime",
- "proxy.config.http.negative_revalidating_list", "proxy.config.ssl.hsts_max_age",
- "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time",
- "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write",
- "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header",
- "proxy.config.http.auth_server_session_private", "proxy.config.http.slow.log.threshold",
- "proxy.config.http.cache.generation", "proxy.config.body_factory.template_base",
- "proxy.config.http.cache.open_write_fail_action", "proxy.config.http.number_of_redirections",
- "proxy.config.http.cache.max_open_write_retries", "proxy.config.http.cache.max_open_write_retry_timeout",
- "proxy.config.http.redirect_use_orig_cache_key", "proxy.config.http.attach_server_session_to_client",
- "proxy.config.websocket.no_activity_timeout", "proxy.config.websocket.active_timeout",
- "proxy.config.http.uncacheable_requests_bypass_parent", "proxy.config.http.parent_proxy.total_connect_attempts",
- "proxy.config.http.transaction_active_timeout_in", "proxy.config.srv_enabled",
- "proxy.config.http.forward_connect_method", "proxy.config.ssl.client.cert.filename",
- "proxy.config.ssl.client.cert.path", "proxy.config.http.parent_proxy.mark_down_hostdb",
- "proxy.config.http.cache.ignore_accept_mismatch", "proxy.config.http.cache.ignore_accept_language_mismatch",
- "proxy.config.http.cache.ignore_accept_encoding_mismatch", "proxy.config.http.cache.ignore_accept_charset_mismatch",
- "proxy.config.http.parent_proxy.fail_threshold", "proxy.config.http.parent_proxy.retry_time",
- "proxy.config.http.parent_proxy.per_parent_connect_attempts", "proxy.config.http.normalize_ae",
- "proxy.config.http.insert_forwarded", "proxy.config.http.proxy_protocol_out",
- "proxy.config.http.allow_multi_range", "proxy.config.http.request_buffer_enabled",
- "proxy.config.http.allow_half_open", ConnectionTracker::CONFIG_SERVER_VAR_MIN,
+ "proxy.config.http.connect_attempts_retry_backoff_base", "proxy.config.http.down_server.cache_time",
Review Comment:
https://github.com/apache/trafficserver/pull/12396 will reduce changed lines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on code in PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397#discussion_r2234694064
##########
src/api/InkAPITest.cc:
##########
@@ -8679,37 +8679,38 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.http.transaction_no_activity_timeout_out", "proxy.config.http.transaction_active_timeout_out",
"proxy.config.http.connect_attempts_max_retries", "proxy.config.http.connect_attempts_max_retries_down_server",
"proxy.config.http.connect_attempts_rr_retries", "proxy.config.http.connect_attempts_timeout",
- "proxy.config.http.down_server.cache_time", "proxy.config.http.doc_in_cache_skip_dns",
- "proxy.config.http.background_fill_active_timeout", "proxy.config.http.response_server_str",
- "proxy.config.http.cache.heuristic_lm_factor", "proxy.config.http.background_fill_completed_threshold",
- "proxy.config.net.sock_packet_mark_out", "proxy.config.net.sock_packet_tos_out",
- "proxy.config.http.insert_age_in_response", "proxy.config.http.chunking.size",
- "proxy.config.http.flow_control.enabled", "proxy.config.http.flow_control.low_water",
- "proxy.config.http.flow_control.high_water", "proxy.config.http.cache.range.lookup",
- "proxy.config.http.default_buffer_size", "proxy.config.http.default_buffer_water_mark",
- "proxy.config.http.request_header_max_size", "proxy.config.http.response_header_max_size",
- "proxy.config.http.negative_revalidating_enabled", "proxy.config.http.negative_revalidating_lifetime",
- "proxy.config.http.negative_revalidating_list", "proxy.config.ssl.hsts_max_age",
- "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time",
- "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write",
- "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header",
- "proxy.config.http.auth_server_session_private", "proxy.config.http.slow.log.threshold",
- "proxy.config.http.cache.generation", "proxy.config.body_factory.template_base",
- "proxy.config.http.cache.open_write_fail_action", "proxy.config.http.number_of_redirections",
- "proxy.config.http.cache.max_open_write_retries", "proxy.config.http.cache.max_open_write_retry_timeout",
- "proxy.config.http.redirect_use_orig_cache_key", "proxy.config.http.attach_server_session_to_client",
- "proxy.config.websocket.no_activity_timeout", "proxy.config.websocket.active_timeout",
- "proxy.config.http.uncacheable_requests_bypass_parent", "proxy.config.http.parent_proxy.total_connect_attempts",
- "proxy.config.http.transaction_active_timeout_in", "proxy.config.srv_enabled",
- "proxy.config.http.forward_connect_method", "proxy.config.ssl.client.cert.filename",
- "proxy.config.ssl.client.cert.path", "proxy.config.http.parent_proxy.mark_down_hostdb",
- "proxy.config.http.cache.ignore_accept_mismatch", "proxy.config.http.cache.ignore_accept_language_mismatch",
- "proxy.config.http.cache.ignore_accept_encoding_mismatch", "proxy.config.http.cache.ignore_accept_charset_mismatch",
- "proxy.config.http.parent_proxy.fail_threshold", "proxy.config.http.parent_proxy.retry_time",
- "proxy.config.http.parent_proxy.per_parent_connect_attempts", "proxy.config.http.normalize_ae",
- "proxy.config.http.insert_forwarded", "proxy.config.http.proxy_protocol_out",
- "proxy.config.http.allow_multi_range", "proxy.config.http.request_buffer_enabled",
- "proxy.config.http.allow_half_open", ConnectionTracker::CONFIG_SERVER_VAR_MIN,
+ "proxy.config.http.connect_attempts_retry_backoff_base", "proxy.config.http.down_server.cache_time",
Review Comment:
This line is the main change. https://github.com/apache/trafficserver/pull/12396 will reduce changes. I'll rebase this when it's merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397#issuecomment-3129027145
[approve ci autest 0]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Retry Connect with Exponential Backoff [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #12397:
URL: https://github.com/apache/trafficserver/pull/12397#discussion_r2237695133
##########
doc/admin-guide/files/records.yaml.en.rst:
##########
@@ -1705,6 +1705,13 @@ Origin Server Connect Attempts
`proxy.config.http.connect_attempts_max_retries`_ so an error is returned to the client faster and also to reduce the load on the down origin.
The timeout interval `proxy.config.http.connect_attempts_timeout`_ in seconds is used with this setting.
+.. ts:cv:: CONFIG proxy.config.http.connect_attempts_retry_backoff_base INT 0
+ :reloadable:
+ :overridable:
+
+ The base delay, in milliseconds, used for exponential backoff between retry attempts to connecto to the origin server. After each
+ failure the delay doubles - e.g. 64m, 128m, 256m. When this is set to `0`, |TS| retries immediately without exponential backoff.
Review Comment:
`connecto`
```yaml
:units: milliseconds
```
Let's indicate that `0` is the default value. Maybe add `(the default value)` after "When this is set to `0`"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org