Help Center/ Relational Database Service/ User Guide/ Working with RDS for MariaDB/ Performance Tuning/ Identifying Why CPU Usage of RDS for MariaDB Instances Is High and Providing Solutions
Updated on 2024-10-14 GMT+08:00

Identifying Why CPU Usage of RDS for MariaDB Instances Is High and Providing Solutions

If the CPU usage of your RDS for MariaDB instance is high or close to 100%, database performance deteriorates. For example, data read/write becomes slow, connecting to the instance takes a longer time, or errors are reported when you are trying to delete data.

Solution

Analyze slow SQL logs and CPU usage to locate slow queries and then optimize them.

  1. View the slow SQL logs to check for slowly executed SQL queries and view their performance characteristics (if any) to locate the cause.

    For details about how to view RDS for MariaDB logs, see Viewing and Downloading Slow Query Logs.

  2. View the CPU usage of your DB instance.

    For details, see Viewing Monitoring Metrics.

  3. Create read replicas to reduce read pressure from primary DB instances.
  4. Add indexes for associated fields in multi-table association queries.
  5. Do not use the SELECT statement to scan all tables. You can specify fields or add the WHERE condition.