Troubleshooting High CPU Utilization in PostgreSQL Databases
summary
Shows concrete SQL checks and fixes: count connections (example 3,457 of 9,057 slots ≈ 38%), list non‑idle sessions and top queries (one query had 40 active connections), find queries >5s and per‑second frequencies, inspect pg_stat_statements costs, rebuild invalid indexes, run VACUUM/autovacuum and ANALYZE, parse Azure logs with AWK, disable JDBC prepared‑statement caching, and tune parameters like statement_timeout >= 30s and random_page_cost = 1 on SSD; includes a proactive scanner with pg_stat_statements probes and example outputs.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 2:36DB connections
- 6:42Distribution of non-idle connections per database and per query
- 9:21The PostgreSQL parameter statement_timeout
- 11:31Running frequent SQL queries
- 14:04The PostgreSQL parameter random_page_cost
- 18:52PostgreSQL DB bloat
related talks
47mIdentifying Slow Queries and Fixing Them!
39mDeep dive into PostgreSQL internal statistics
41mOptimizing your app by understanding your PostgreSQL database
51mPostgreSQL Query Performance Insights
49mHELP!!1! The database is slow!!
50mPostgreSQL Query Performance Insights
24mTop 5 PostgreSQL Query Tuning Tips
27mPostgres Performance in 15 Minutes
