Optimize Cloud SQL instances with high number of out-of-memory events Stay organized with collections Save and categorize content based on your preferences.
Preview
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. You can process personal data for this feature as outlined in theCloud Data Processing Addendum, subject to the obligations and restrictions described in the agreement under which you access Google Cloud. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
This page describes the Cloud SQL instance out-of-memory (OOM) optimizationrecommender which helps you detect instances that have a high number of OOM events within the last seven days.
This recommender detects instances that havea high number of OOM events. It then provides recommendations on how to optimize suchinstances and improve performance. Recommendations are generated daily.
Pricing
The Cloud SQL OOM optimization recommender is in theStandardRecommender pricing tier.
Before you begin
Before you can view recommendations and insights, do the following:
- To get the permissions to view and work with insights and recommendations,ensure that you have the requiredIdentity and Access Management (IAM) roles.
For more information about IAM roles, seeIAM basic and predefined roles reference andManage access to projects, folders, and organizations.Tasks Roles View recommendations One of these roles: recommender.cloudsqlViewerorcloudsql.viewer.Apply recommendations One of these roles: recommender.cloudsqlAdmin,cloudsql.editor, orcloudsql.admin. Enable the Recommender API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.
List OOM optimization recommendations for an instance
You can list OOM optimization recommendations for an instanceusing the Google Cloud console,gcloud CLI, or the Recommender API.
Console
To list recommendations about instance performance by using the
Google Cloud console, follow these steps:
- Go to theCloud SQL Instances page.
- ClickExpand Details on theImprove instance health by investigating issues and acting on recommendations banner.
Alternatively, follow these steps:
Go to theActive Assist. See alsoFind and apply recommendations with the Recommendations.
ClickPerformance in theAll recommendations card.
gcloud CLI
To list OOM optimization recommendations for an instance using gcloud CLI, run thegcloud recommender recommendations listcommand as follows:
gcloud recommender recommendations list \--project=PROJECT_ID \--location=LOCATION \--recommender=google.cloudsql.instance.PerformanceRecommender \--filter=recommenderSubtype=MYSQL_FREQUENT_OUT_OF_MEMORY_BEST_PRACTICE
Replace the following:
PROJECT_ID: Your project ID.LOCATION: A region where your instances are located, such asus-central1.
API
To list OOM optimization recommendations for an instance using theRecommendations API, call therecommendations.listmethod as follows:
GET https://recommender.googleapis.com/v1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations
Replace the following:
PROJECT_ID: Your project ID.LOCATION: A region where your instances are located, such asus-central1.
If the recommender detects instances with frequent OOM events, it lists them in a table. Each row shows the instance name, a brief recommendation, the current machine type, the recommended machine type, the location, and the last refresh date.
View insights and detailed recommendations
You can view insights and detailed recommendations for instancesthat require an OOM optimization using the Google Cloud console,gcloud CLI, or the Recommender API.
Console
Do one of the following:
On thePerformance Recommendations page, clickPerformance recommendations card, clickFrequent Out-of-Memory Best Practice. The recommendation panel appears, which contains insights and detailed recommendations for the instance.
On theInstances page, clickFrequent Out-of-Memory Best Practice. The list of instances displays only those instances for which the recommendation applies.
gcloud CLI
To view insights and detailed recommendations about instances that require an OOM optimization, run thegcloud recommender insights listcommand as follows:
gcloud recommender insights list \--project=PROJECT-ID \--location=LOCATION \--insight-type=google.cloudsql.instance.PerformanceInsight \--filter=insightSubtype=MYSQL_FREQUENT_OUT_OF_MEMORY
Replace the following:
PROJECT_ID: Your project ID.LOCATION: A region where your instances are located, such asus-central1.
API
To view insights and detailed recommendations about instances that require an OOM optimization, use theRecommendations API, call theinsights.listmethod as follows:
GET https://recommender.googleapis.com/v1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights
Replace the following:
PROJECT_ID: Your project ID.LOCATION: A region where your instances are located, such asus-central1.
Apply recommendation
Evaluate the recommendation carefully and do any of the following:
- For more information, seeOptimize instance high memory usage.
- To dismiss the recommendation so that it's de-emphasized and appears dimmed,clickDismiss.
- To close the panel without applying or dismissing the recommendation, clickCancel.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.