fix(helm): raise workerRlimitNofile to 2x workerConnections - #27
Open
Eric Hibbs (flowstate) wants to merge 1 commit into
Open
fix(helm): raise workerRlimitNofile to 2x workerConnections#27Eric Hibbs (flowstate) wants to merge 1 commit into
Eric Hibbs (flowstate) wants to merge 1 commit into
Conversation
The chart shipped 8192 worker_connections against a 2048 descriptor limit. nginx spends two descriptors per proxied connection (client plus upstream), so a worker ran out of descriptors at roughly a quarter of its configured connection ceiling and started failing accept() under load rather than reaching the limit operators had tuned. 16384 matches the ratio Socket's own hosted firewall deployments run.
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.
What & why
The chart ships
workerConnections: 8192againstworkerRlimitNofile: 2048. nginx spends two file descriptors per proxied connection — one to the client, one to the upstream — so a worker exhausts descriptors at roughly a quarter of its configured connection ceiling. Past that point it failsaccept()withToo many open filesinstead of reaching the limit an operator tuned, and the failure surfaces as refused or hung connections rather than as anything naming the real cause.16384 is the ratio Socket's own hosted firewall deployments already run against the same 8192 connection count, on the same image.
Testing
helm lint helm/passes.helm template test helm/rendersworker_rlimit_nofile: 16384into the generatedsocket.ymlconfigmap, alongside the unchangedworker_connections: 8192.Notes
Raising the value only raises the ceiling nginx requests via
setrlimit; container hard limits sit far above 16384 and workers allocate descriptors on demand, so nothing is reserved at startup.Note
Low Risk
Default tuning only in Helm values; it raises nginx’s soft FD ceiling without changing auth, routing, or application logic.
Overview
Raises the Helm chart default
nginx.workerRlimitNofilefrom 2048 to 16384 so it matches 2×workerConnections(8192). Proxied traffic uses two file descriptors per connection (client + upstream); with the old ratio, workers could hit “Too many open files” well below the configured connection limit.Adds a short comment in
helm/values.yamldocumenting thatworkerRlimitNofileshould be at least 2×workerConnections. The value still flows into the generatedsocket.ymlasworker_rlimit_nofilevia the chart ConfigMap.Reviewed by Cursor Bugbot for commit af77c2c. Configure here.