Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
MySQL | PostgreSQL | SQL Server
Auf dieser Seite wird beschrieben, wie Sie temporäre Binärprotokolldateien und InnoDB-Wiederherstellungsprotokolldateien verwalten. Dieser Recommender heißt Logeinstellungen neu konfigurieren.
Dieser Recommender analysiert täglich Folgendes:
Die Speicherplatznutzung im Cache für binäre Protokolle und binäre Protokollanweisungen. Wenn mehr als 10% Ihrer Transaktionen und nicht transaktionalen Anweisungen in temporäre Dateien auf dem Laufwerk schreiben, wird durch Logeinstellungen neu konfigurieren empfohlen, den Wert von binlog_cache_size oder binlog_stmt_cache_size zu erhöhen, um die Leistung zu verbessern.
Weitere Informationen zum Erhöhen des Werts von binlog_cache_size finden Sie unter Cache-Arbeitsspeicherverbrauch. Weitere Informationen zum Erhöhen des Werts von binlog_stmt_cache_size finden Sie unter binlog_stmt_cache_size.
Das Verhältnis der Wartezeit zur Schreibzeit für die InnoDB-Rückgängig-Logs. Dieser Recommender empfiehlt, den Wert von innodb_log_buffer_size zu erhöhen, wenn Transaktionen auf das Leeren des Logpuffers warten.
Weitere Informationen zum Erhöhen des Werts von innodb_log_buffer_size finden Sie unter [Zwischenspeicher-Arbeitsspeicherverbrauch](/sql/docs/mysql/).
Preise
Der Recommender Protokolleinstellungen neu konfigurieren befindet sich in der Recommender-PreisstufeStandard.
Prüfen Sie, ob Sie die erforderlichen IAM-Rollen (Identity and Access Management) haben, um die Berechtigungen zum Aufrufen und Verwenden von Informationen und Empfehlungen zu erhalten.
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations
Ersetzen Sie Folgendes:
PROJECT_ID: Ihre Projekt-ID.
LOCATION: Eine Region, in der sich Ihre Instanzen befinden, z. B. us-central1.
Informationen und detaillierte Empfehlungen anzeigen
So rufen Sie Statistiken und detaillierte Empfehlungen auf:
Console
Führen Sie einen der folgenden Schritte aus:
Klicken Sie auf der Seite Leistungsempfehlungen auf die Karte Leistungsempfehlungen und dann auf Protokolleinstellungen neu konfigurieren.
Der Bereich „Empfehlung“ wird angezeigt. Dieser enthält Informationen und detaillierte Empfehlungen für die Instanz.
Klicken Sie auf der Seite Instanzen auf Protokolleinstellungen neu konfigurieren. In der Liste der Instanzen werden nur die Instanzen angezeigt, für die die Empfehlung gilt.
LOCATION: Eine Region, in der sich Ihre Instanzen befinden, z. B. us-central1.
INSIGHT_SUBTYPE: Legen Sie für diesen Parameter einen der folgenden Werte fest:
MYSQL_LOW_BINLOG_CACHE_SIZE: zeigt Informationen zur Anzahl der transaktionalen binären Logs unter Verwendung des Festplatten-Cache für Ihre Instanz an.
MYSQL_LOW_BINLOG_STMT_CACHE_SIZE: Statistiken zur Anzahl der binären Logs für nicht transaktionale Anweisungen mit dem On-Disk-Cache für Ihre Instanz anzeigen
MYSQL_LOW_INNODB_LOG_BUFFER_SIZE: Statistiken zur Wartezeit im Vergleich zur Schreibzeit für InnoDB-Redo-Logs anzeigen
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights
Ersetzen Sie Folgendes:
PROJECT_ID: Ihre Projekt-ID.
LOCATION: Eine Region, in der sich Ihre Instanzen befinden, z. B. us-central1.
Empfehlung anwenden
So implementieren Sie diese Empfehlung:
Erhöhen Sie den Wert von binlog_stmt_cache_size oder binlog_cache_size.
Weitere Informationen zum Erhöhen des Werts von binlog_stmt_cache_size finden Sie unter binlog_stmt_cache_size. Weitere Informationen zum Erhöhen des Werts von binlog_cache_size finden Sie unter Cache-Arbeitsspeicherverbrauch.
Gestalten Sie Ihre Transaktionen so, dass sie klein sind. Verwenden Sie weniger Caches für binäre Logs und binäre Loganweisungen.
Erhöhen Sie den Wert von innodb_log_buffer_size. Weitere Informationen zum Erhöhen des Werts von innodb_log_buffer_size finden Sie unter Zwischenspeicher-Arbeitsspeicherverbrauch.
Erhöhen Sie die Größe des nichtflüchtigen Speichers, damit Sie genügend parallele E/A-Anfragen haben, um das Verhältnis von Lese- zu Schreibvorgängen für die Protokolldateien zu verbessern.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Reconfigure log settings\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to manage temporary binary log files and InnoDB redo log\nfiles. This [recommender](/recommender/docs/recommenders) is called\n**Reconfigure log settings**.\n\nEvery day, this recommender analyzes the following:\n\n- Disk usage in the binary log and binary log statement caches. If more than\n 10% of your transactions and non-transactional statements write to temporary\n files on disk, then **Reconfigure log settings** recommends that you should\n increase the value of `binlog_cache_size` or `binlog_stmt_cache_size` to\n improve performance.\n\n For more information on increasing the value of `binlog_cache_size`, see\n [Cache memory consumption](/sql/docs/mysql/optimize-high-memory-usage#cache_memory_consumption). For more information on\n increasing the value of `binlog_stmt_cache_size`, see\n [`binlog_stmt_cache_size`](/sql/docs/mysql/flags#mysql-b).\n- The ratio of wait time versus write time for the InnoDB redo logs. This\n recommender advises increasing the value of `innodb_log_buffer_size` if\n transactions are waiting for the log buffer to flush.\n\n For more information on increasing the value of `innodb_log_buffer_size`, see\n \\[Buffer memory consumption\\](/sql/docs/mysql/\n\nPricing\n-------\n\nThe **Reconfigure log settings** recommender is in the *Standard*\n[Recommender pricing tier](/recommender/pricing).\n\nBefore you begin\n----------------\n\n[Enable the Recommender API](/recommender/docs/enabling).\n\n### Required roles and permissions\n\nTo get the permissions to view and work with insights and recommendations,\nensure that you have the required [Identity and Access Management (IAM) roles](/sql/docs/mysql/project-access-control#roles).\n\nFor more information about IAM roles, see [IAM basic and predefined roles reference](/iam/docs/understanding-roles) and [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\u003cbr /\u003e\n\nList the recommendations\n------------------------\n\nTo list the recommendations, follow these steps: \n\n### Console\n\nTo list recommendations about instance performance, follow these steps:\n\n1. Go to the **Cloud SQL Instances** page.\n\n[Go to Cloud SQL Instances](https://console.cloud.google.com/sql/instances)\n\n1. On the **Improve instance health by investigating issues and acting on recommendations** banner, click **Expand Details**.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub** . See also [Find and apply recommendations with the Recommendations](/recommender/docs/recommendation-hub/identify-configuration-problems).\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n2. In the **All recommendations** card, click **Performance** .\n\n### gcloud\n\nRun the [`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list) command as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.PerformanceRecommender \\\n--filter=recommenderSubtype=MYSQL_RECONFIG_TRANS_LOGS\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\n### API\n\nCall the [`recommendations.list`](/recommender/docs/reference/rest/v1/projects.locations.recommenders.recommendations/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\nView insights and detailed recommendations\n------------------------------------------\n\nTo view insights and detailed recommendations, follow these steps: \n\n### Console\n\nDo one of the following:\n\n- On the **Performance Recommendations** page, click the **Performance\n recommendations** card and then click **Reconfigure log settings**.\n The recommendation panel appears, which contains insights and\n detailed recommendations for the instance.\n\n- On the **Instances** page, click **Reconfigure log settings**. The list of\n instances displays only those instances for which the recommendation\n applies.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.PerformanceInsight \\\n--filter=insightSubtype=INSIGHT_SUBTYPE\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n- \u003cvar translate=\"no\"\u003eINSIGHT_SUBTYPE\u003c/var\u003e: set this parameter to one of the following:\n - `MYSQL_LOW_BINLOG_CACHE_SIZE`: display insights for the number of transactional binary logs using the on-disk cache for your instance\n - `MYSQL_LOW_BINLOG_STMT_CACHE_SIZE`: display insights for the number of non-transactional statement binary logs using the on-disk cache for your instance\n - `MYSQL_LOW_INNODB_LOG_BUFFER_SIZE`: display insights for the wait time compared to the write time for InnoDB redo logs\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\n\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\nApply the recommendation\n------------------------\n\nTo implement this recommendation, do one of the following:\n\n- Increase the value of either `binlog_stmt_cache_size` or `binlog_cache_size`.\n\n For more information on increasing the value of `binlog_stmt_cache_size`, see\n [`binlog_stmt_cache_size`](/sql/docs/mysql/flags#mysql-b). For more\n information on increasing the value of `binlog_cache_size`, see\n [Cache memory consumption](/sql/docs/mysql/optimize-high-memory-usage#cache_memory_consumption).\n- Design your transactions to be small and use less of the binary log and binary\n log statement caches.\n\n- Increase the value of `innodb_log_buffer_size`. For more information on\n increasing the value of `innodb_log_buffer_size`, see\n [Buffer memory consumption](/sql/docs/mysql/optimize-high-memory-usage#buffer_memory_consumption).\n\n- Increase the persistent disk size so that you have enough parallel I/O\n requests to improve ratio of read operations to write operations for the log\n files.\n\n| **Note:** Increasing `binlog_stmt_cache_size`, `binlog_cache_size`, and `innodb_log_buffer_size` requires more memory. After increasing these flags, monitor the memory usage.\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)"]]