Skip to main content

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 VACUUM or Index builds.

What to do

  1. Find Slow Queries: Check the Query Insights tab in pgpulse for queries with high "Total Time".
  2. Check for Sequential Scans: Look for tables with high scan rates that lack supporting indexes.
  3. Verify Bloat: Check if autovacuum is keeping up; excessive bloat increases the work CPU has to do.
  4. Reduce Concurrency: If using Supabase, check if you're hitting CPU limits on a smaller instance size.