Pq: remaining connection slots are reserved for non-replication superuser connections (code: 2)

When I log in to the portal I get this message and it happens in all the accounts I have active. At certain times it lets me log in and then when I want to send a DL it kicks me and for a few hours I can not enter. Not only happens when I send a DL but also when I want to make a configuration change, such as deleting a user and change password. I tried to unsubscribe from all of them and use only one and the same thing happens. I tried changing the password and still nothing. I have also noticed that the platform has a slow response when interacting with it.

I have +500 devices connected please if anyone knows how to fix it, I would appreciate it.

strong text

Please take a look at the PostgreSQL connection settings (max open and max idle) within ChirpStack, and the limits that are enforced by your PostgreSQL installation. It sounds ChirpStack is keeping more connections open than that is allowed by PostgreSQL.

Many thanks for your quick response @brocaar !

Hi everyone,

Our server was working fine for a long time. Then suddenly it started showing this error when I log in and the gateways would be down everytime this error occurs. The network and application server are creating more connections than it is allowed to so I tried to allow more connections in postgresql but new active and idle connections just keeps on increasing. I’m afraid to increase the max_connections more than I should. If someone can help me understand why this is happening and how that would be a great help.