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

Add a check for the total pgbouncer pool_size less than the PostgreSQL max_connections (#236) #237

Merged
merged 13 commits into from
Jan 25, 2023

Conversation

artemsafiyulin
Copy link
Contributor

@artemsafiyulin artemsafiyulin commented Dec 30, 2022

MR for issue #236
add 3 tasks:

  • calculate pgbouncer total pool_size (if not defined pool_size, then calculate as pgbouncer_default_pool_size)
  • get number of max connections from "postgresql_parameters" variable
  • if total_pool_size > max_connections and pgbouncer_pools not empty, task will be failed and send special message

@vitabaks
Copy link
Owner

@artemsafiyulin Thanks!

calculate pgbouncer total pool_size (when pool_parameters not defined it will be 0)

In this case, the default_pool_size parameter has a value.

We have it declared as a variable pgbouncer_default_pool_size, it would not be bad to multiply this number by postgresql_databases for which pool_parameters are not declared. What do you think?

@vitabaks vitabaks changed the title Issue #236 Add a check for the total pgbouncer pool_size less than the PostgreSQL max_connections (#236) Jan 18, 2023
@artemsafiyulin
Copy link
Contributor Author

artemsafiyulin commented Jan 19, 2023

@vitabaks I add support calculating with default_pool_size. Now we have 5 steps:

  1. get count of databases in postgresql (without templates)
  2. calculate size of pools defined in variable pgbouncer_pools
  3. calculate total pool size (add to previous step count of not defined in pgbouncer_pools databases * default_pool_size)
  4. get max_connections value
  5. compare total_pool_size and max_connections

@vitabaks vitabaks merged commit 12c676b into vitabaks:master Jan 25, 2023
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.

2 participants