Repository navigation
feat: support backlog in listen and if= condition in access_log via nginx_config - #14031
Open
Ethan-Zhang-ZH wants to merge 2 commits into
Open
Ethan-Zhang-ZH wants to merge 2 commits into
Ethan-Zhang-ZH wants to merge 2 commits into
Conversation
Allow an optional `backlog` field per node_listen item, which renders the `backlog=N` parameter of the nginx listen directive. This lets operators size the pending connections queue from config.yaml instead of relying on the default 511, which can overflow under connection spikes when only the host-level net.core.somaxconn is tuned. Fixes part of apache#14022 Signed-off-by: zhangshumin01 <10682145+Ethan-Zhang-ZH@users.noreply.github.com>
Allow an optional `access_log_if` field under nginx_config.http, which renders an `if=<condition>` parameter on the access_log directive. The condition is evaluated in the log phase and can reference variables declared via http_configuration_snippet (map / split_clients), enabling log sampling or per-status/per-endpoint log exclusion with plain nginx config, without any Lua plugin. Fixes part of apache#14022 Signed-off-by: zhangshumin01 <10682145+Ethan-Zhang-ZH@users.noreply.github.com>
Ethan-Zhang-ZH
force-pushed
the
feat/issue-14022
branch
from
October 13, 2026 03:32
ed7bd44 to
9b6af47
Compare
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
Please refer to #14022. This PR implements both enhancements proposed there.
1.
backlogfor listen socketsRenders the
backlog=Nparameter of the nginxlistendirective, so operators cansize the pending connections queue from config.yaml instead of relying on the default
511 (which can overflow under connection spikes even when host-level
net.core.somaxconnis tuned).2.
if=condition for access_logRenders an
if=<condition>parameter on theaccess_logdirective. The condition isevaluated in the log phase and can reference variables declared via
http_configuration_snippet(map/split_clients), enabling log sampling orper-status / per-endpoint log exclusion with plain nginx config, without any Lua plugin.
It is also the generic fix for #10407.
Changes
apisix/cli/ops.lua: pass an optional, validatedbacklog(positive integer) throughlisten_table_insertapisix/cli/ngx_tpl.lua: renderbacklog=Nandif=<condition>when configured (output is byte-identical when absent)conf/config.yaml.example: document both fieldst/cli/test_main.sh: backlog rendering + invalid-value test casest/cli/test_access_log.sh:if=rendered / not-rendered test casesBoth fields are optional and fully backward compatible. All
t/clisuites touched bythese changes pass locally.
Fixes #14022