CPU utilization

RDSCPUUtilization #

Meaning #

This alert is triggered when the RDS instance has high CPU usage.

Impact #

High CPU usage degrades database performance.

Diagnosis #

  1. Open RDS Performance Insights to identify queries consuming the server’s CPU.

  2. Check queries that are currently running on the CPU

    SQL
    SELECT pid, usename, datname, application_name, now() - query_start duration, left(query, 60)
    FROM   pg_stat_activity
    WHERE  state = 'active'
        AND    wait_event_type IS NULL
        AND    wait_event IS NULL
    ORDER BY duration desc;
    

Mitigation #

  • Kill CPU-intensive SQL queries

  • Reduce the number of database connections

  • Check CPU and disk saturation. You may need to upscale the RDS instance

Additional resources #