CPU & Load
CPU usage represents the processing work being done by your database. High CPU is often the first sign that your queries are working harder than they should.
Symptoms
- Increased API response times.
- Dashboard graphs showing sustained peaks near 100%.
- "Load Average" significantly higher than the number of available CPU cores.
What it usually means
- Expensive Queries: Complex joins or aggregations without proper indexing.
- Missing Indexes: Postgres has to scan entire tables (sequential scans) instead of using an index.
- Bursts: Sudden spikes in traffic (e.g., a marketing launch).
- Maintenance: Intensive background tasks like
VACUUMor Index builds.
What to do
- Find Slow Queries: Check the Query Insights tab in pgpulse for queries with high "Total Time".
- Check for Sequential Scans: Look for tables with high scan rates that lack supporting indexes.
- Verify Bloat: Check if autovacuum is keeping up; excessive bloat increases the work CPU has to do.
- Reduce Concurrency: If using Supabase, check if you're hitting CPU limits on a smaller instance size.