The postmaster process in PostgreSQL runs a single-threaded main loop that handles connection spawning, worker reaping, and parallel query workers. Under extreme load with high connection rates (1400+ connections/sec) and background worker churn, this single-threaded bottleneck can saturate a CPU core, causing 10-15 second

7m read timeFrom recall.ai
Post cover image
Table of contents
TL;DRSlow connections to postgresA reproduction environmentA deep dive into the postmasterProfiling the postmasterHuge pagesBackground workersUnravelling the mysteryFixing the issueConclusion
1 Comment

Sort: