How to change the postgresql.conf parameter "max_connections" on Google Cloud SQL?
When I exceed 100 connections I get the error: "FATAL: remaining connection slots are reserved for non-replication superuser connections"
How to change the postgresql.conf parameter "max_connections" on Google Cloud SQL?
When I exceed 100 connections I get the error: "FATAL: remaining connection slots are reserved for non-replication superuser connections"
Normally you would do it via CloudSQL flags API (or UI): https://cloud.google.com/sql/docs/postgres/flags
However, max_connections
is not a parameter we currently support. We (Postgres team in CloudSQL) are aware that low max_connections
is a problem for some (many?) applications and will address issue in one of the next releases.
Please follow issue 37271935 on our public issue tracker for updates.
Years later, it seems like it's supported now.
For the Terraform gang, you can update the parameter this way:
resource "google_sql_database_instance" "main" {
name = "main-instance"
database_version = "POSTGRES_14"
region = "us-central1"
settings {
tier = "db-f1-micro"
database_flags {
name = "max_connections"
value = 100
}
}
}
Note that at the time of writing the db-f1-micro
default max_connections
is 25, refs https://cloud.google.com/sql/docs/postgres/flags#postgres-m
© 2022 - 2024 — McMap. All rights reserved.