# Database Error: remaining connection slots are reserved for non-replication superuser connections

This error usually occurs when the database reaches the maximum number of connections allowed based on the compute add-on.

To overcome this, the connections need to be optimized as mentioned here: [/docs/guides/platform/performance#optimizing-the-number-of-connections](/docs/guides/platform/performance#optimizing-the-number-of-connections)

Additionally, you can try using the connection pool to help solve this issue:
[/docs/guides/database/connecting-to-postgres/pooling-and-limits#how-connection-pooling-works](/docs/guides/database/connecting-to-postgres/pooling-and-limits#how-connection-pooling-works)

If you're already using connection pooling and still hitting the maximum connections, then it is suggested to upgrade your compute add-on that allows more connections: [/docs/guides/platform/compute-and-disk](/docs/guides/platform/compute-and-disk)
