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

Feature: Allow keepalive to be disabled when set to 0 #3716

Closed
wants to merge 1 commit into from
Closed

Feature: Allow keepalive to be disabled when set to 0 #3716

wants to merge 1 commit into from

Conversation

pryorda
Copy link
Contributor

@pryorda pryorda commented Aug 18, 2018

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

  • Implemented ability to disable upstream_keepalive

Issues resolved

Possibly: #3287

@pryorda
Copy link
Contributor Author

pryorda commented Aug 18, 2018

Let me know if I missed something. This is my first lua pull.

Copy link
Member

@thibaultcha thibaultcha left a 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 the next 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

Copy link
Member

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.

@@ -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
Copy link
Member

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 thibaultcha added the pr/changes requested Changes were requested to this PR by a maintainer. Please address them and ping back once done. label Aug 19, 2018
@pryorda pryorda changed the base branch from master to next August 20, 2018 17:58
@pryorda pryorda changed the base branch from next to master August 20, 2018 18:02
@pryorda pryorda changed the base branch from master to next August 20, 2018 18:02
@pryorda
Copy link
Contributor Author

pryorda commented Aug 20, 2018

@thibaultcha Should be good to go now. Let me know if I missed anything or did it wrong.

thibaultcha pushed a commit that referenced this pull request Aug 21, 2018
When `upstream_keepalive = 0`, we do not inject the `keepalive`
directive in the Nginx config template's upstream block.

From #3716
@thibaultcha
Copy link
Member

@pryorda Manually merged to next with a few edits, thanks!

Will you be able to provide documentation for this change as well? Thank you!

@pryorda
Copy link
Contributor Author

pryorda commented Aug 21, 2018

@thibaultcha Created here: Kong/docs.konghq.com#827

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/changes requested Changes were requested to this PR by a maintainer. Please address them and ping back once done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants