#Hi upgraded to 2026.2.0 and i have in server logs: FATAL: sorry, too many clients already

1 messages · Page 1 of 1 (latest)

hard elk
#

I'm using official docker-compose with postgres 16 image.

dark nebula
#

Oh yeah, I've noticed this too on my end, Authentik seems to be keeping a large number of idle connections open for some reason. I've somewhat mitigated it on my installation by setting idle_session_timeout (in postgres) to something like 1h or so (and increasing maximum connections to 500 or so).

On my setup (which is a 2 node postgres cluster, and authentik is set to connect directly to the master node, and using a read replica), it seems to stablize at around 100 open connections on the master node, at any given time.

Which for a 2 server / 2 worker instance, is in my opinion, a stupid amount of connections to have open. Especially since most of them is sitting IDLE. If it wasn't for the fact that authentik is using postgres LISTEN, I'd run all of it through pgbouncer in transaction mode.

Before I actively started trying to mitigate it, I've seen it hit 140+ open connections, and with other applications and only 200 max connections, it would also hit the exact same issue (too many clients) which caused many many weird issues.

hard elk
#

Do You find solution. I'm using 1 node postgre with 1 worker, and server restarts with this issue every 20-30 minutes

dark nebula
#

yeah, like i said, my workaround was to set postgres to expire the idle connections, and to increase max connections.

full idol
#

Me toooooo!!!

abstract gust