PrefectPostgreSQLAmazon RDS

Database connection pool exhaustion causes severe API slowdown after Prefect 3.x upgrade

critical
Connection ManagementUpdated Apr 24, 2025(via Exa)
How to detect:

After upgrading from Prefect 2.x to 3.x, API response times degrade dramatically (simple GET /flow_runs/{id} taking ~3 seconds vs. sub-second previously). Database shows high lock contention with CPU well under limit, indicating connection pool saturation rather than compute bottleneck.

Recommended action:

Increase database connection pool settings. Current pool_size of 60 and max_overflow of 10 may be insufficient for Prefect 3.x workload patterns. Monitor active connections against pool size. Consider enabling the database vacuum background service to prevent data accumulation. Review whether all background services need to run concurrently.