Reconfigure log settings

MySQL  |  PostgreSQL  |  SQL Server

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 how to manage temporary binary log files and InnoDB redo logfiles. Thisrecommender is calledReconfigure log settings.

Every day, this recommender analyzes the following:

  • Disk usage in the binary log and binary log statement caches. If more than10% of your transactions and non-transactional statements write to temporaryfiles on disk, thenReconfigure log settings recommends that you shouldincrease the value ofbinlog_cache_size orbinlog_stmt_cache_size toimprove performance.

    For more information on increasing the value ofbinlog_cache_size, seeCache memory consumption. For more information onincreasing the value ofbinlog_stmt_cache_size, seebinlog_stmt_cache_size.

  • The ratio of wait time versus write time for the InnoDB redo logs. Thisrecommender advises increasing the value ofinnodb_log_buffer_size iftransactions are waiting for the log buffer to flush.

    For more information on increasing the value ofinnodb_log_buffer_size, see[Buffer memory consumption](/sql/docs/mysql/

Pricing

TheReconfigure log settings recommender is in theStandardRecommender pricing tier.

Before you begin

Enable the Recommender API.

Required roles and permissions

To get the permissions to view and work with insights and recommendations, ensure that you have the requiredIdentity and Access Management (IAM) roles.

TaskRole
View recommendationsrecommender.cloudsqlViewer orcloudsql.admin
Apply recommendationscloudsql.editor orcloudsql.admin
For more information about IAM roles, seeIAM basic and predefined roles reference andManage access to projects, folders, and organizations.

List the recommendations

To list the recommendations, follow these steps:

Console

To list recommendations about instance performance, follow these steps:

  1. Go to theCloud SQL Instances page.

Go to Cloud SQL Instances

  1. On theImprove instance health by investigating issues and acting on recommendations banner, clickExpand Details.

Alternatively, follow these steps:

  1. Go to theActive Assist. See alsoFind and apply recommendations with the Recommendations.

    Go to the Active Assist

  2. In theAll recommendations card, clickPerformance .

gcloud

Run thegcloud recommender recommendations list command as follows:

gcloud recommender recommendations list \--project=PROJECT_ID \--location=LOCATION \--recommender=google.cloudsql.instance.PerformanceRecommender \--filter=recommenderSubtype=MYSQL_RECONFIG_TRANS_LOGS

Replace the following:

  • PROJECT_ID: your project ID
  • LOCATION: a region where your instances are located, such asus-central1

API

Call therecommendations.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

View insights and detailed recommendations

To view insights and detailed recommendations, follow these steps:

Console

Do one of the following:

  • On thePerformance Recommendations page, click thePerformancerecommendations card and then clickReconfigure log settings.The recommendation panel appears, which contains insights anddetailed recommendations for the instance.

  • On theInstances page, clickReconfigure log settings. The list ofinstances displays only those instances for which the recommendationapplies.

gcloud

Run thegcloud 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 asus-central1
  • INSIGHT_SUBTYPE: set this parameter to one of the following:
    • MYSQL_LOW_BINLOG_CACHE_SIZE: display insights forthe number of transactional binary logs using the on-disk cache foryour instance
    • MYSQL_LOW_BINLOG_STMT_CACHE_SIZE: display insights forthe number of non-transactional statement binary logs using theon-disk cache for your instance
    • MYSQL_LOW_INNODB_LOG_BUFFER_SIZE: display insights forthe wait time compared to the write time for InnoDB redo logs

API

Call theinsights.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 the recommendation

To implement this recommendation, do one of the following:

  • Increase the value of eitherbinlog_stmt_cache_size orbinlog_cache_size.

    For more information on increasing the value ofbinlog_stmt_cache_size, seebinlog_stmt_cache_size. For moreinformation on increasing the value ofbinlog_cache_size, seeCache memory consumption.

  • Design your transactions to be small and use less of the binary log and binarylog statement caches.

  • Increase the value ofinnodb_log_buffer_size. For more information onincreasing the value ofinnodb_log_buffer_size, seeBuffer memory consumption.

  • Increase the persistent disk size so that you have enough parallel I/Orequests to improve ratio of read operations to write operations for the logfiles.

Note: Increasingbinlog_stmt_cache_size,binlog_cache_size, andinnodb_log_buffer_size requires more memory. After increasing these flags,monitor the memory usage.

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 2026-02-05 UTC.