Raise default max_clients to 16384, add a recv_buffer option - #195
Open
williamthome wants to merge 1 commit into
Open
Raise default max_clients to 16384, add a recv_buffer option#195williamthome wants to merge 1 commit into
williamthome wants to merge 1 commit into
Conversation
max_clients 150 -> 16384, matching the modern BEAM HTTP-server defaults. It is a counter cap, not an allocation, so the higher default costs nothing until connections arrive; the effective cap is min(max_clients, the OS FD limit), so high concurrency needs ulimit -n raised. The hardcoded 64 KB TCP recv buffer becomes the recv_buffer listener opt.
williamthome
changed the base branch from
main
to
fix/acceptor-transient-errors
August 2, 2026 18:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #196.
max_clientsdefaulted to 150, which refuses connections long before the VM or the OS is under real pressure. The default moves to 16384. Saturation memory scales asmax_clients × recv_buffer, so the socket receive buffer that was hardcoded at 64 KB becomes therecv_bufferlistener option, giving a direct lever to trade body-path throughput for per-connection memory rather than forcing the cap back down.The higher default puts the binding limit on the OS rather than the listener: the effective cap is
min(max_clients, ulimit -n), and a host left at a 1024 descriptor limit will now reachemfilebefore reachingmax_clients. That is documented on the option, and it is observable rather than silent, since the acceptors emit[roadrunner, listener, accept_error]at the descriptor ceiling and keep accepting (#196). Deployments that want the old behaviour of a clean refusal at a fixed low ceiling can setmax_clientsexplicitly.