Hello,
The SQLA
Pooling section says that the default connection pool (QueuePool is the default pool, isn’t it?) has 5 connections with an overflow of 10 (
docs).
However, in our configuration we use
sqlalchemy.pool_recycle = 3600
sqlalchemy.pool_pre_ping = True
sqlalchemy.pool_size = 20
sqlalchemy.max_overflow = 30
Independently of how many connections the PG server accepts (looks like 100 by default,
docs) a single gRPC server process has a global Engine instance with a connection pool of that configured size.
Without too many requests flowing through our gRPC server process, we already see these errors:
Assuming that we have the implementation correct (a global Engine and its connection pool, sessions fetching and releasing connections correctly) the error can mean one of two things:
- too many simultaneous requests hold a connection too long; or
- these settings aren’t realistic for a production server environment.
Is there another angle I might be missing? What configuration settings would you recommend? Other than turning on debugging (
docs) what tips do you have to debug the issue?
Much thanks!
Jens