-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Feature: Allow keepalive to be disabled when set to 0 #3716
Conversation
Let me know if I missed something. This is my first lua pull. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pryorda!
Thank you for the patch! We'd be happy to merge it, but would need a few things out of you before that can happen:
- Please address the review comments (including the need for unit tests)
- Changes to the nginx config template must target the
next
branch, since they are breaking for everyone using a custom template; please rebase your patch on top of thenext
branch, and change the base branch of your PR
Thank you!
Dockerfile
Outdated
WORKDIR /build | ||
RUN apk add --no-cache openssl openssl-dev git | ||
RUN make dev && make test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unrelated changes from this PR, such as this Dockerfile and the Makefile rule added below, along with the README change. Thank you!
keepalive ${{UPSTREAM_KEEPALIVE}}; | ||
> end |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
kong.conf.default
Outdated
@@ -213,6 +213,8 @@ | |||
# preserved in the cache of each worker | |||
# process. When this number is exceeded, the | |||
# least recently used connections are closed. | |||
# 0 will remove the entry conf nginx-kong.conf | |||
# when using the default template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you please update this description to something like:
A value of `0` will disable this behavior altogether,
forcing each upstream request to open a new connection.
nginx-kong.conf
and "the default template" are implementation details that should not be mentioned here. Additionally, the proposed text is more explicit as to what the behavior is when the given value is 0
.
@thibaultcha Should be good to go now. Let me know if I missed anything or did it wrong. |
When `upstream_keepalive = 0`, we do not inject the `keepalive` directive in the Nginx config template's upstream block. From #3716
@pryorda Manually merged to next with a few edits, thanks! Will you be able to provide documentation for this change as well? Thank you! |
@thibaultcha Created here: Kong/docs.konghq.com#827 Thanks |
Summary
Allow Engineers to disable keeaplive by setting upstream_keepalive to 0. In our infrastructure we did not want to have nginx workers keeping the backend connections alive that were to externally lb services. This fixed various connection resets for us.
Full changelog
Issues resolved
Possibly: #3287