too many clients are connected


  • Log messages around the central topic of too many clients are connected

  • Even panic and tracebacks may appear in the logs / output of fylr, like: (shortened here)

ERR Recover from panic, rolling back error="could not start read transaction: [...]
/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
/usr/local/go/src/net/http/server.go:3086 +0x5cb


There are already more connections from fylr to the PostgreSQL database service than the configured limit in PostgreSQL.


We recommend to set the limits in fylr and postgres to the same number.

An example can bee seen here:

You may also need to find the correct limit for your situation.

Change limit in fylr

In fylr yaml configuration: fylr.db.maxOpenConns

  • If you use this, fylr will try to stay below the new limit and the errors may go away.

  • If you use a limit far below what your hardware can handle, you may slow fylr down.

Change limit in PostgreSQL

  • If you increase this limit, the error might go away or appear less frequent.

  • But PostgreSQL may consume more memory.

  • In docker-compose.yml add a line like -c max_connections=200 . 200 is just an example. The line shall be below the line with command for the postgresql service. The default seems to be 100.

Last updated