Help Center > > FAQs> Database Performance> What Should I Do When the CPU Usage of My RDS MySQL DB Instance Is High?

What Should I Do When the CPU Usage of My RDS MySQL DB Instance Is High?

Updated at: Apr 20, 2020 GMT+08:00

If the CPU usage is high or close to 100% when you use RDS for MySQL, data read/write processing is slow, connections cannot be obtained, and errors are reported, affecting your service running.

Solution

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

    For details on viewing MySQL logs, see section Viewing and Downloading Slow Query Logs.

  2. View the CPU usage metric of your RDS DB instance to facilitate problem locating.

    For details, see Configuring Displayed Metrics.

  3. Create read replicas to offload read pressure on primary DB instances.
  4. When multiple associated tables are queried, indexes must be created for the associated fields.
  5. Do not use the SELECT statement to scan all tables. You can specify fields or add the where condition.
  6. You can use the Data Admin Service (DAS) to identify SQL statements that are executed frequently, consume a large amount of resources, or take a long time to execute. You can optimize the database according to the diagnosis suggestions to ensure the stability of the database performance.

    For details, see SQL Tuning.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel