Help Center/ GaussDB(for MySQL)/ FAQs/ Database Performance/ What Should I Do If the CPU Usage of My GaussDB(for MySQL) Instance Is High?
Updated on 2024-09-05 GMT+08:00

What Should I Do If the CPU Usage of My GaussDB(for MySQL) Instance Is High?

If the CPU usage is high or close to 100% when you use GaussDB(for MySQL), data read/write processing slows down, connections cannot be established, and errors are reported, interrupting services.

Solution

  1. Check slow SQL logs for slow queries and examine their performance characteristics (if any) to locate the cause.

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

  2. View the CPU usage of your GaussDB(for MySQL) instance to facilitate problem locating.

    For details, see Introducing GaussDB(for MySQL) Metrics.

  3. Create read replicas to offload read pressure from the primary node.
  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.