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

fix(kuma-cp) Limit number of postgres connection by default #2866

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

parkanzky
Copy link
Contributor

Signed-off-by: Paul Parkanzky paul.parkanzky@konghq.com

Summary

CP previously did not limit number of postgres connections. In our performance benchmarking, we determined this can cause significant problems when connecting large numbers of dataplanes. This is configurable via env variables, but this PR limits by default.

Full changelog

  • Limit number of postgres connections by default.

Issues resolved

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
@parkanzky parkanzky requested a review from a team as a code owner October 1, 2021 15:47
Paul Parkanzky added 2 commits October 1, 2021 15:50
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
@jpeach
Copy link
Contributor

jpeach commented Oct 4, 2021

@parkanzky Is there anything special or optimal about 50?

@parkanzky
Copy link
Contributor Author

parkanzky commented Oct 4, 2021

@parkanzky Is there anything special or optimal about 50?

@jpeach The only special consideration is that postgres defaults maximum connections to 100. Users should be able to set up a mesh + postgres using defaults without us clobbering pg, so our default needs to be less than that. I tested 50 with with 1000 DPPs on 1 CP and didn't see any pg bottlenecks. If user needs to scale postgres, then they can scale this value as well.

@parkanzky parkanzky merged commit 851bc8d into master Oct 4, 2021
@parkanzky parkanzky deleted the fix/sane-pg-conn-defaults branch October 4, 2021 22:03
mergify bot pushed a commit that referenced this pull request Oct 4, 2021
* fix(kuma-cp) Limit number of postgres connection by default

Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>

* tests(kuma-cp) Fix test affected by default pg vals

Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>

* tests(kuma-cp) Fix spacing

Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
(cherry picked from commit 851bc8d)
jakubdyszkiewicz pushed a commit that referenced this pull request Oct 5, 2021
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
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.

None yet

3 participants