Quantcast
Channel: Zammad - Community - Latest posts
Viewing all articles
Browse latest Browse all 6760

Scheduler fails with "ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use>"

$
0
0

So I’ve spent another hour or so trying to get the combination of config settings right in puma.rb / database.yml / postgresql.conf. Without any success unfortunately.

A postgresql.conf setting of max_connections = 5000
With a database.yml of pool: 50 and puma.rb workers 1 and threads 5, 10 still results in the same ‘could not obtain a connection’ error.

From my understanding this should have the effect that each puma worker (of which only workers 1 is allowed) should have a pool of pool: 50 available database connections. Each puma worker is allowed to scale between threads 1, 10 threads depending on the server load (default between 5 and 30 threads).

If the server load then goes up, the server will create max 10 threads with these settings. So there shouldn’t ever be more than 10 threads waiting for a database connection. Since the pool size is 50 there shouldnt be an error that its waiting for a connection. Yet this does happen. Possible reasons could be things such as connections not being returned to the pool or connections being made outside of the pool context. That goes a bit over my head to troubleshoot any further.


Viewing all articles
Browse latest Browse all 6760

Trending Articles