This page describes how to manage instances with a high number of open tables and a high number of open table definitions. This recommender is called Manage open tables.
Every day, this recommender analyzes metrics for the following:
- The number of open tables or open table definitions for an instance as follows:
- If the number of open tables or open table definitions increases by 1 table every 2 seconds, or faster, during the previous 24 hours.
- If the number of open tables or open table definitions is equal to or more
than the value of
table_open_cacheandtable_definition_cache, respectively. If either of these are true, then the recommender advises you to increase the value oftable_open_cacheortable_definition_cache.
For more information on increasing the value of table_open_cache
and table_definition_cache
, see Table limit
.
Pricing
The Manage open tablesrecommender is in the Standard Recommender pricing tier .
Before you begin
Required roles and permissions
To get the permissions to view and work with insights and recommendations, ensure that you have the required Identity and Access Management (IAM) roles .
| Task | Role |
|---|---|
| View recommendations | recommender.cloudsqlViewer
or cloudsql.admin
|
| Apply recommendations | cloudsql.editor
or cloudsql.admin
|
List the recommendations
To list the recommendations, follow these steps:
Console
To list recommendations about instance performance, follow these steps:
- Go to the Cloud SQL Instancespage.
- On the Improve instance health by investigating issues and acting on recommendationsbanner, click Expand Details.
Alternatively, follow these steps:
-
Go to the Active Assist. See also Find and apply recommendations with the Recommendations .
-
In the All recommendationscard, click Performance.
gcloud
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_RECONFIG_OPEN_TABLES
Replace the following:
- PROJECT_ID : your project ID
- LOCATION
: a region where your instances are located, such as
us-central1
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 as
us-central1
View insights and detailed recommendations
To view insights and detailed recommendations, follow these steps:
Console
Do one of the following:
-
On the Performance Recommendationspage, click the Performance recommendationscard and then click Manage open tables. The recommendation panel appears, which contains insights and detailed recommendations for the instance.
-
On the Instancespage, click Manage open tables. The list of instances displays only those instances for which the recommendation applies.
gcloud
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= INSIGHT_SUBTYPE
Replace the following:
- PROJECT_ID : your project ID
- LOCATION
: a region where your instances are located, such as
us-central1 - INSIGHT_SUBTYPE
: set this parameter to one of the following:
-
MYSQL_HIGH_NUMBER_OF_OPEN_TABLES: display insights for the number of open tables for your instance -
MYSQL_HIGH_NUMBER_OF_OPEN_TABLE_DEFINITIONS: display insights for the number of open table definitions for your instance
-
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 as
us-central1
Apply the recommendation
To implement this recommendation, do one of the following:
-
For a high number of open tables, increase the value of
table_open_cacheby 500 until the recommendation disappears. -
For a high number of open table definitions, increase the value of
table_definition_cacheby 500 until the recommendation disappears.
This recommendation is updated daily, so after you increase the value of either table_open_cache
or table_definition_cache
, wait for 24 hours before
checking the recommendation again. For more information on increasing the value
of table_open_cache
and table_definition_cache
, see Table limit
.

