No improvment in Cloud SQL CPU usage even after upgrade

Hi,
I recently noticed our Cloud MySQL instance which has a config of 1 vCPU and 3.75GB memory and the CPU utilization going up to 100%, so I did an upgrade on the instance by increasing the vCPUs to 2. What I noticed was that still the utilization showing the same trend which was quite surprising.

Now I assumed that even full 2 vCPUs are getting utilized by the queries and that’s why the usage is still going up to 100%. So, now I tried editing the instance again to increase the vCPU count again. But once I clicked edit the count shown inside was still showing up as 1 but outside it keeps showing 2. At this point I feel like it’s a bug.

If anyone else has faced a similar issue and managed to fix it, please guide me through the process.

Thanks!

The high CPU utilization on your Cloud MySQL instance could be caused by a number of factors, such as:

  • An increase in workload.
  • Heavy transactions.
  • Slow queries.
  • Long running transactions.
  • A bug in the MySQL software.

Even after upgrading the vCPUs to 2, if the utilization remains high, it suggests that the root cause might be more complex than just CPU resource allocation.

To troubleshoot the issue, you can try the following steps:

  1. Check the running queries and optimize them. You can use the following queries to see the number of active threads and the ongoing queries:
SHOW STATUS like 'Threads_%';
SHOW [FULL] PROCESSLIST;

  1. Look for queries that are taking a long time to run. You can use the following query to see the queries that have been running for more than a certain amount of time:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE TIME > 60;

  1. Review and optimize MySQL configuration parameters. Some parameters, when misconfigured, can lead to high CPU utilization. Refer to the MySQL documentation to understand and adjust these settings appropriately.

  2. If you have third-party MySQL plugins installed, evaluate their performance impact. Some plugins can contribute to high CPU utilization.

  3. Regarding the discrepancy in the vCPU count displayed in the Cloud Console, it might be a UI bug or a synchronization issue. Try refreshing the page, clearing the browser cache and cookies, or restarting the browser. If the issue persists, I recommend reaching out to Google Cloud support for further assistance

@ms4446 Thanks for the elaborated answer. After clearing cache the edit screen now shows updated count of CPUs. Now that I’m sure that the count has actually updated I can look for solutions on optimizing queries.