Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

CloudSQL Swap Size

I use CloudSQL for MySQL (Enterprise Plus, vCPU4, Memory 32 GB, SSD 500 GB). I am working on monitoring CloudSQL using Cloud Monitoring. I tried to know the used ratio of swap space using this metric. However, there are no metrics about the maximum bytes in swap space.

I would like to detect the lack of swap space in Cloud Monitoring.

So, I have some questions as follows:

1) What is the exact swap space limit size?

2) Does the swap space limit automatically increase?

Solved Solved
1 1 954
1 ACCEPTED SOLUTION

Cloud SQL MySQL does not explicitly specify the swap space limit for Cloud SQL instances. The swap space is managed by Google Cloud and is not directly exposed or configurable by users.

  1. The exact swap space limit size is not publicly documented by Google. It's managed internally by Google Cloud.

  2. Google Cloud manages the swap space automatically, but it doesn't necessarily increase the limit automatically. The swap space is used when the system requires more memory than it is physically available.

If you're consistently seeing high swap usage, it might be an indicator that your instance is under-provisioned. You might need to increase the size of your Cloud SQL instance or optimize your database queries and connections to reduce memory usage.

For monitoring, while there might not be a direct metric for swap space, you can monitor "Memory usage" and "CPU usage" which can give you an idea about the resource usage and if your instance is under stress.

View solution in original post

1 REPLY 1

Cloud SQL MySQL does not explicitly specify the swap space limit for Cloud SQL instances. The swap space is managed by Google Cloud and is not directly exposed or configurable by users.

  1. The exact swap space limit size is not publicly documented by Google. It's managed internally by Google Cloud.

  2. Google Cloud manages the swap space automatically, but it doesn't necessarily increase the limit automatically. The swap space is used when the system requires more memory than it is physically available.

If you're consistently seeing high swap usage, it might be an indicator that your instance is under-provisioned. You might need to increase the size of your Cloud SQL instance or optimize your database queries and connections to reduce memory usage.

For monitoring, while there might not be a direct metric for swap space, you can monitor "Memory usage" and "CPU usage" which can give you an idea about the resource usage and if your instance is under stress.