Skip to content

feat(nginx): add config to update the backlog of nginx#625

Merged
sambhav-jain-16 merged 1 commit into
uber:masterfrom
sambhav-jain-16:nginx-backlog-config
May 26, 2026
Merged

feat(nginx): add config to update the backlog of nginx#625
sambhav-jain-16 merged 1 commit into
uber:masterfrom
sambhav-jain-16:nginx-backlog-config

Conversation

@sambhav-jain-16
Copy link
Copy Markdown
Collaborator

@sambhav-jain-16 sambhav-jain-16 commented May 21, 2026

What?

Add a configurable backlog value for nginx for all kraken services

Why?

Although the max value of the accept queue in the host is

cat /proc/sys/net/core/somaxconn
4096

The actual value still defaults to the accept queue limit from nginx (511) since
$$\text{Send-Q} = \min(\text{Application Backlog}, \text{somaxconn})$$

ss -lnt
State             Recv-Q            Send-Q                        Local Address:Port                          Peer Address:Port            Process
LISTEN            0                 511                                 0.0.0.0:8351                               0.0.0.0:*
LISTEN            0                 511                                 0.0.0.0:9003                               0.0.0.0:*

This has caused listen drops on the hosts during sudden load (such as prefetching).
This change aims to add a config option to set this limit. If config is not defined, the current defaults are used for backward compatibility.

Copilot AI review requested due to automatic review settings May 21, 2026 09:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable listen_backlog setting to the nginx config generation so deployments can tune the TCP accept backlog used by nginx listen directives.

Changes:

  • Introduces listen_backlog as a new nginx.Config YAML setting and injects it into template params.
  • Updates nginx component templates (agent/origin/proxy/tracker/build-index) to optionally render backlog=<value> on listen directives.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nginx/nginx.go Adds ListenBacklog to config and injects listen_backlog into template params.
nginx/config/agent.go Adds optional backlog=... to the agent listen directive.
nginx/config/origin.go Adds optional backlog=... to the origin listen directive.
nginx/config/proxy.go Adds optional backlog=... to the proxy listen directive(s).
nginx/config/tracker.go Adds optional backlog=... to the tracker listen directive.
nginx/config/build-index.go Adds optional backlog=... to the build-index listen directive.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nginx/nginx.go
Comment thread nginx/nginx.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@sambhav-jain-16 sambhav-jain-16 marked this pull request as ready for review May 22, 2026 11:22
Comment thread nginx/nginx.go Outdated
@sambhav-jain-16 sambhav-jain-16 merged commit e4b6b3c into uber:master May 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants