You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following #497, we store new connections that were accepted in a VecDeque, without putting a limit on its size. We regularly remove new connections by creating client sessions, but we could also refuse to add more connections to that queue if we have too many waiting.
Are there cases where it would be useful?
This should probably be tested under benchmarks before deciding anything.
The optional evict_on_queue_full switch evicts the least-recently-active sessions instead of refusing (bin/config.toml#L117-L124).
Saturation is observable through listener.connection_capped and accept_queue.saturated_seconds, and queue depth through the accept_queue.connections gauge.
Maximum age of a queued connection (the follow-up comment). This is accept_queue_timeout (seconds, default 60), carried in ServerConfig (command.proto#L1859) and documented in bin/config.toml#L248-L252. create_sessions drops any entry older than this and counts it in accept_queue.timeout (server.rs#L3781-L3787).
Closing as completed; please reopen if a distinct queue-length limit, independent of max_connections, is still wanted.
Activity
Geal commentedon Jul 30, 2021
also make the maximum age of a connection configurable
FlorentinDUBOIS commentedon Sep 29, 2026
Both questions raised here are now answered by configuration on
main(ebf4b70):Bounding the accept queue. The queue is bounded by the worker's session budget rather than by a separate size knob.
max_connectionsis reached,check_limitsclearscan_accept(server.rs#L987).accept_ready; no new socket isaccept()ed intoaccept_queue(server.rs#L3921-L3925).evict_on_queue_fullswitch evicts the least-recently-active sessions instead of refusing (bin/config.toml#L117-L124).listener.connection_cappedandaccept_queue.saturated_seconds, and queue depth through theaccept_queue.connectionsgauge.Maximum age of a queued connection (the follow-up comment). This is
accept_queue_timeout(seconds, default 60), carried inServerConfig(command.proto#L1859) and documented in bin/config.toml#L248-L252.create_sessionsdrops any entry older than this and counts it inaccept_queue.timeout(server.rs#L3781-L3787).Closing as completed; please reopen if a distinct queue-length limit, independent of
max_connections, is still wanted.