v.24.8Improvement
ClickHouse Introduces max_keep_alive_requests Setting for HTTP Connections
ClickHouse server now supports new settingmax_keep_alive_requests. For keep-alive HTTP connections to the server it works in tandem withkeep_alive_timeout- if idle timeout not expired but there already more thanmax_keep_alive_requestsrequests done through the given connection - it will be closed by the server. #61793 (Nikita Taranov).
Why it matters
This feature enhances connection management by allowing the server to close HTTP keep-alive connections after a specified number of requests have been served. It works alongsidekeep_alive_timeout to ensure efficient resource usage and prevent excessively long-lived connections, which can improve stability and performance under heavy load.How to use it
Set themax_keep_alive_requests parameter in the server configuration or via the SETTINGS clause to specify the maximum requests allowed per HTTP keep-alive connection. The connection will be closed once this number is reached, even if the keep_alive_timeout has not expired.