# Adjust the PostgreSQL Max Connections

High-availability deployments require more connections than those provided by the default value. Set the value high enough to account for the connection pool sizes of all Nexus Repository nodes as well as a buffer for DBAs and automated tools that connect directly to the database.

- Adjust the `max_connections` property in PostgreSQL’s `postgresql.conf` file.

See [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-connection.html)

Increasing the connections available requires more resources for the PostgreSQL server. Make sure your server has enough resources to handle the additional load. See the [PostgreSQL requirements](https://help.sonatype.com/en/sonatype-nexus-repository-system-requirements.html#database-requirements "Database Requirements") for recommendations on server sizing. Your specific reference architecture also includes these recommendations.

## Determining the max_connections

Consider the following example:

1. 3 Nexus Repository nodes in an HA cluster
2. Each node has the default `maximumPoolSize` setting of 100 connections  
   See [Maximum Pool Size](https://help.sonatype.com/en/install-nexus-repository-with-a-postgresql-database.html "Install Nexus Repository with a PostgreSQL Database")
3. For this case, we recommend setting the `max_connections` to `350`.

## Troubleshooting

Nexus Repository nodes may fail to start when not enough connections are available. You may see the following error in PostgreSQL:

```
FATAL: sorry, too many clients already
```
