Skip to main content

Connection limits per plan for Aiven for PostgreSQL®

Find the default max_connections value for each Aiven for PostgreSQL® plan, and learn how to change it for your service.

By default, Aiven for PostgreSQL® instances limit the number of allowed connections to make sure that the database is able to serve them all.

max_connections defaults​

Default values of the max_connections setting vary according to the service plan:

PlanMax connections
Developer15
Free20
Hobbyist25
Startup/Business/Premium-4100
Startup/Business/Premium-8200
Startup/Business/Premium-16400
Startup/Business/Premium-32800
Startup/Business/Premium-64 and above1000

Aiven for PostgreSQL doesn't apply a fixed per-GiB connection formula (for example, 100 connections per GiB of RAM). The plan-based defaults in the preceding table are the only default values, and there's no separate max_connection_limit setting. max_connections is the only parameter that controls the total number of connections for your service.

tip

During a connection-exhaustion incident, use an AI assistant connected to Aiven MCP to check current connection usage against the configured limit. For example:

Show the current connection count on my-pg-service, grouped by role and state, and compare the total with max_connections.

Reserved connections​

Your service does not make all max_connections connections available to your applications. Aiven reserves some of them for database maintenance and monitoring.

Every Aiven for PostgreSQL service reserves three connections for superuser access, which Aiven uses to manage the service. Depending on the PostgreSQL version and the service, Aiven reserves three more connections for monitoring, for a total of six. Changing max_connections does not change the number of reserved connections.

For example, on a plan with the default max_connections of 100:

  • When three connections are reserved, at most 97 remain for your applications.
  • When six connections are reserved, at most 94 remain for your applications.

Reserved connections guarantee that Aiven always has capacity available, but Aiven is not limited to them. Monitoring and service management can also use non-reserved connections. The remaining capacity is therefore an upper limit, not a guarantee for your applications.

When you size connection pools, subtract six from max_connections. This keeps the combined pool size within the limit on any service.

Increase or decrease max_connections​

To increase or decrease the number of allowed connections for your service, set the max_connections parameter, which accepts a value from 25 to 60000.

note

Changing max_connections causes a service restart. If your service has a read replica, increase the replica's value first. After that change is applied, increase the primary service's value.

  1. Log in to Aiven Console, and go to your organization > project > Aiven for PostgreSQL service.
  2. On the Overview page of your service, select Service settings from the sidebar.
  3. On the Service settings page, go to the Advanced configuration section, and select Configure.
  4. Select Add configuration options, add the max_connections parameter, set the value, and select Save configuration.

Use connection pooling​

When several clients or client threads are connecting to the database, Aiven recommends using connection pooling to limit the number of actual backend connections. Connection pooling is available in all Aiven for PostgreSQL Startup, Business, and Premium plans, and can be configured in the console.

Related pages