-
Notifications
You must be signed in to change notification settings - Fork 7
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
bug: configure maximum db connections #32
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.
LGTM, with comment
4345fd9
to
dbc3fe3
Compare
1472c86
to
136ad9d
Compare
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.
LGTM, nice!
ffafa27
to
b03f125
Compare
b03f125
to
5fdb8fc
Compare
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.
Nice! Appreciate the README change too
The PR includes the following changes:
pool_mode
tosession
sincepg_advisory_lock
cannot be supported bytransaction
modemaas-region
units, so it has to be a 1-1 mapping. The extra 10, if not used they will be closed by PgBouncer.experimental_max_connections
to PostgreSQL charm with three options:default
: It does not setexperimental_max_connections
at all. It will use the system defaults of PostgreSQLdynamic
: It configuresexperimental_max_connections
based on the number of maas-region units. If chosen, it will use the maximum of 100 (default max connections) and 50 *number_of_region_units
+ 10 (required by PgBouncer). This option also includes a restart of the PostgreSQL server units, so it is up to the practitioner to use it.100<=n<=500
): It statically configures theexperimental_max_connections
of the PostgreSQL server. If specified during bootstrap (e.g., the MAAS cluster topology is predefined and total number of regions is known), it will be set from the beginning.ReapplyPostgreSQLTerraformPlanStep
that will re-configure theexperimental_max_connections
when newregion
nodes are joining/leaving the cluster and max_connections mechanism is set todynamic
Fixes: #11