-
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
feat(db): exposed postgres connection pooling config #9603
Conversation
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.
Related pgmoon PR:
This PR is indeed needed for improving the Postgres connections.
@dndx Should we expose this level of detail? Can dynamic scaling of workers cause bad surprises? |
@hbagdi As long as we provide reasonable defaults this should not be a bad thing to have. Most user don't need to touch it anyway. |
@shettyh great job! Could you add a changelog entry in the |
Let's merge it after 3.1 release. |
@samugi updated changelog, please check |
@mayocream rebased, one of the test is still failing with config error |
Summary
As of now there is no straight forward way to control the number of postgres connections created. There are some workarounds like setting lua_socket_pool_size, but that has it own downsides as it effects the global upstream connection pool also.
Because of this kong can bring down the postgres instance in case of high load and most of request are resulting in a cache miss. As part of this change exposed config to control this behaviour.
This change does not impact the default behaviour of kong
Full changelog
pg_keepalive_timeout
to control the postgres connection idle timeoutpg_pool_size
to control the postgres connection pool sizepg_backlog
to limit the open connections to postgres