This page describes the Cloud SQL instance out-of-memory (OOM) optimization recommender which helps you detect instances that have a high number of OOM events within the last seven days.
This recommender detects instances that have a high number of OOM events. It then provides recommendations on how to optimize such instances and improve performance. Recommendations are generated daily.
Pricing
The Cloud SQL OOM optimization recommender is in the Standard Recommender 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 required Identity and Access Management (IAM) roles.
For more information about IAM roles, see IAM basic and predefined roles reference and Manage access to projects, folders, and organizations.
Tasks Roles View recommendations One of these roles: recommender.cloudsqlViewer
orcloudsql.viewer
.Apply recommendations One of these roles: recommender.cloudsqlAdmin
,cloudsql.editor
, orcloudsql.admin
. -
Enable the Recommender API.
List OOM optimization recommendations for an instance
You can list OOM optimization recommendations for an instance
using the Google Cloud console, gcloud CLI
, or the Recommender API.
To list recommendations about instance performance by using the
Google Cloud console, follow these steps:
- Go to the Cloud SQL Instances page.
- Click Expand Details on the Improve instance health by investigating issues and acting on recommendations banner.
Alternatively, follow these steps:
Go to the Recommendation Hub. See also Find and apply recommendations with the Recommendations.
Click Performance in the All recommendations card.
To list OOM optimization recommendations for an instance using gcloud CLI, run the
gcloud recommender recommendations list
command 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
.
To list OOM optimization recommendations for an instance using the
Recommendations API, call the
recommendations.list
method 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 instances
that require an OOM optimization using the Google Cloud console,
gcloud CLI
, or the Recommender API.
Do one of the following:
On the Performance Recommendations page, click Performance recommendations card, click Frequent Out-of-Memory Best Practice. The recommendation panel appears, which contains insights and detailed recommendations for the instance.
On the Instances page, click Frequent Out-of-Memory Best Practice. The list of instances displays only those instances for which the recommendation applies.
To view insights and detailed recommendations about instances that require an OOM optimization, run the
gcloud recommender insights list
command 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
.
To view insights and detailed recommendations about instances that require an OOM optimization, use the
Recommendations API, call the
insights.list
method 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, see Optimize instance high memory usage.
- To dismiss the recommendation so that it's de-emphasized and appears dimmed, click Dismiss.
- To close the panel without applying or dismissing the recommendation, click Cancel.