Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport -> release/3.5.x] perf(proxy): use higher default keepalive request value for Nginx tuning (#12223) #12530

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/unreleased/kong/optimize_keepalive_parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: Bumped default values of `nginx_http_keepalive_requests` and `upstream_keepalive_max_requests` to `10000`.
type: performance
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although this PR modifies the default value of NGINX, it doesn't have a significant impact on the client's side. Therefore, I don't believe we need to categorize this feature as a breaking_change.

Typically, users won't notice this alteration. However, under stressful testing scenarios, they might observe an increase in NGINX's performance, specifically in RPS

scope: Configuration
2 changes: 1 addition & 1 deletion kong.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@
# It is recommended to set it to at least (number of regex paths * 2)
# to avoid high CPU usages.

#nginx_http_keepalive_requests = 1000 # Sets the maximum number of client requests that can be served through one
#nginx_http_keepalive_requests = 10000 # Sets the maximum number of client requests that can be served through one
# keep-alive connection. After the maximum number of requests are made,
# the connection is closed.
# Closing connections periodically is necessary to free per-connection
Expand Down
4 changes: 2 additions & 2 deletions kong/templates/kong_defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ headers_upstream = x-kong-request-id
trusted_ips = NONE
error_default_type = text/plain
upstream_keepalive_pool_size = 512
upstream_keepalive_max_requests = 1000
upstream_keepalive_max_requests = 10000
upstream_keepalive_idle_timeout = 60
allow_debug_header = off

Expand All @@ -96,7 +96,7 @@ nginx_http_proxy_ssl_conf_command = NONE
nginx_http_lua_ssl_conf_command = NONE
nginx_http_lua_regex_match_limit = 100000
nginx_http_lua_regex_cache_max_entries = 8192
nginx_http_keepalive_requests = 1000
nginx_http_keepalive_requests = 10000
nginx_stream_ssl_conf_command = NONE
nginx_stream_proxy_ssl_conf_command = NONE
nginx_stream_lua_ssl_conf_command = NONE
Expand Down
Loading