MySQL | PostgreSQL | SQL Server
The Cloud SQL out-of-disk recommender proactively generates recommendations that help you reduce the risk of downtime that might be caused by your instances running out of disk space. You can apply these recommendations when a Cloud SQL instance is trending toward a storage limit.
How it works
The Cloud SQL out-of-disk recommender analyzes the storage utilization trend over the last 30 days. When an instance is trending toward a limit where it’s likely to run out of space within the next 1 to 30 days, a recommendation is generated that suggests one of the following actions:
- Manually increase the storage capacity
- Automatically increase the storage capacity
- Delete data to free up space
The following table lists the recommendation and insights that the Cloud SQL out-of-disk recommender can generate.
Insight | Insight subtype | Recommendation |
---|---|---|
Based on the current storage use trend, the instance is likely to run out of disk space, which can result in downtime. | TRENDING_ | Enable auto grow, manually increase storage capacity, or free up disk space |
Pricing
This recommender falls under the standard recommender pricing tier that is available at no additional cost. See the recommender pricing page for more details on pricing tiers.
Before you begin
Before you can view the recommendations and insights, do the following:
- To use the Google Cloud Console, read the related documentation.
- To use the command-line examples in this guide, install or update to the latest version of the gcloud command-line tool.
- To use the API examples in this guide, set up API access.
- Make sure that you have the required roles. These roles provide a set of permissions that enable you to view and work with the insights and recommendations.TasksRolesView recommendationsEither
recommender.
orcloudsqlViewer cloudsql.
Apply recommendationsOne of these:viewer recommender.
,cloudsqlAdmin cloudsql.
, oreditor cloudsql.
For more information about roles, see understanding roles and granting IAM permissions.admin - Enable the Recommender API.
Recommender IDs
These are the out-of-disk recommender IDs:
google.cloudsql.instance.OutOfDiskRecommender
google.cloudsql.instance.DiskUsageTrendInsight
Required IAM permissions
To access the list of Cloud SQL recommendations and insights, the following permissions are required:
recommender.cloudsqlInstanceOutOfDiskRecommendations.get
recommender.cloudsqlInstanceOutOfDiskRecommendations.list
recommender.cloudsqlInstanceOutOfDiskRecommendations.update
recommender.cloudsqlInstanceDiskUsageTrendInsights.get
recommender.cloudsqlInstanceDiskUsageTrendInsights.list
recommender.cloudsqlInstanceDiskUsageTrendInsights.update
For more details on these permissions, see Project Access Control.
View out-of-disk recommendations
This section describes how to check for out of disk insights and recommendations using the Cloud Console, gcloud
, and the API.
Console:
To view recommendations for an instance by using the Cloud Console, follow the steps below:
- In the Cloud Console, go to the Cloud SQL Instances page.Go to Cloud SQL Instances
- To view recommendations, click VIEW ALL on the banner that displays the number of instances that are at or nearing capacity.Note: This banner appears only if you have instances that are nearing the disk capacity.
- To view details of the recommendation, click the recommendation corresponding to an instance from the list. On the corresponding recommendation page, you can do any of the following:
- To go to the overview page of the instance, click VIEW INSTANCE.
- If you do not want to apply the recommendation, click DISMISS.
Alternatively, follow the steps below:
- In the Cloud Console, go to the Recommendation Hub.Go to the Recommendation HubFor more information, see Getting started with Recommendation Hub.
- In the Prevent Downtime for SQL instances card, click View all to view the list of recommendations.Note: If you don’t see such a card, you either don’t have the permission to view the recommendations or there aren’t any recommendations for the current project.
- Click a recommendation from the list to view the recommendation details for that instance.
- Do any of the following:
- To go to the overview page of the instance, click VIEW INSTANCE.
- If you do not want to apply the recommendation, click DISMISS.