Auf dieser Seite wird beschrieben, was Managed Connection Pooling ist und wie Sie damit die Verwaltung von Datenbankverbindungen für Ihre Cloud SQL-Instanzen mithilfe von Pooling optimieren können.
Mit Managed Connection Pooling können Sie Ihre Arbeitslasten skalieren, indem Sie die Ressourcennutzung und die Verbindungs-Latenz für Ihre Cloud SQL-Instanzen mithilfe von Pooling optimieren.
Beim verwalteten Verbindungs-Pooling wird ein Pool von Threads erstellt, um eingehende Anfragen zu verarbeiten. Dies führt zu einer erheblichen Leistungssteigerung, insbesondere bei skalierten Verbindungen, da plötzliche Verbindungsspitzen abgefangen werden, ohne den Server durch eine Zunahme der Anzahl der Threads zu überlasten.
Damit Sie Managed Connection Pooling verwenden können, muss Ihre Instanz die folgenden Anforderungen erfüllen:
Ihre Instanz muss eine Cloud SQL Enterprise Plus-Instanz sein.
Für das verwaltete Verbindungs-Pooling ist eine Mindestwartungsversionsnummer von MYSQL_$version.R20250531.01_10 erforderlich. Weitere Informationen zur Self-Service-Wartung finden Sie unter Self-Service-Wartung durchführen.
Mit der Option max_pool_size wird die Parallelität für das verwaltete Verbindungs-Pooling gesteuert.
Der Standardwert hängt von der Anzahl der vCPU-Kerne in der Maschinenkonfiguration Ihrer Instanz ab.
Beschränkungen
Wenn Sie Managed Connection Pooling mit Ihren Cloud SQL Enterprise Plus-Instanzen verwenden, sollten Sie die folgenden Einschränkungen beachten:
Wenn Sie das verwaltete Verbindungspooling für eine vorhandene Instanz aktivieren, wird die Datenbank neu gestartet.
Wenn der verwaltete Verbindungspool für Ihre Instanz aktiviert ist, wird der Wert des Messwerts thread_cache_size standardmäßig auf 0 gesetzt.
[[["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,["# Managed Connection Pooling overview\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/sql/docs/postgres/managed-connection-pooling \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview\n| --- [Managed Connection Pooling](/sql/docs/mysql/managed-connection-pooling)**\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 what Managed Connection Pooling is and how to use it with your\nCloud SQL instances.\n\nManaged Connection Pooling lets you scale your workloads by optimizing resource utilization\nand connection latency for your Cloud SQL for MySQL instances using pooling.\nManaged Connection Pooling creates a pool of threads to handle\nincoming requests. This delivers significant performance improvements,\nespecially for scaled connections, by absorbing sudden connection spikes without\noverloading the server with a growth in the number of threads.\n\n\nWhile you can use Managed Connection Pooling for any transactional workloads,\nManaged Connection Pooling provides the most throughput and latency benefit with applications\nthat contain short-lived connections, or applications that result in a\nconnection surge.\n\nFor long-lived connections, the connection performance using\nManaged Connection Pooling can be slightly lower than when using a direct\nconnection. In this case, Managed Connection Pooling provides connection\nscaling when the number of connections is very high. However, for\napplications that typically establish long-lived connections, you might use\ndirect connections to your instance instead.\n\nFor more information on how to enable Managed Connection Pooling, see\n[Configure Managed Connection Pooling](/sql/docs/mysql/configure-mcp).\n\nRequirements\n------------\n\nTo use Managed Connection Pooling, your instance must meet the following requirements:\n\n- Your instance must be a Cloud SQL Enterprise Plus edition instance.\n- Managed Connection Pooling requires a minimum maintenance version number of `MYSQL_$version.R20250304.00_01`. For more information, see [Perform self-service maintenance](/sql/docs/mysql/self-service-maintenance).\n\nPorts used by Managed Connection Pooling for Cloud SQL instances\n----------------------------------------------------------------\n\nWhen you enable Managed Connection Pooling, the ports used by Cloud SQL instances to serve database traffic change. Managed Connection Pooling changes how MySQL handles connections, but the port numbers remain the same. The ports used by Managed Connection Pooling are as follows:\n\n- **TCP port 3306** : used for direct connections by the MySQL database server. This is the default port number used when [directly connecting using mysql client](/sql/docs/mysql/connect-admin-ip#connect).\n- **TCP port 3307**: used for the Cloud SQL Auth Proxy only connections by the Managed Connection Pooling server. When you use Cloud SQL Auth Proxy to connect to Managed Connection Pooling server, this port number is configured with the Cloud SQL Auth Proxy client and can't be changed.\n\nAvailable configuration options\n-------------------------------\n\nYou can [customize Managed Connection Pooling](/sql/docs/mysql/configure-mcp#modify-mcp) by using the following configuration parameters:\n\n\u003cbr /\u003e\n\n- `max_pool_size`: the amount of concurrency for MCP. The default value is number of cores in your database.\n\nLimitations\n-----------\n\nConsider the following limitations when using Managed Connection Pooling with\nyour Cloud SQL Enterprise Plus edition instances:\n\n- Enabling Managed Connection Pooling on an existing instance results in a database restart.\n- When you use the Cloud SQL API to enable, disable, or configure Managed Connection Pooling, the `instance.update` API can't contain any other instance configuration updates.\n\nWhat's next\n-----------\n\n- [Create an instance](/sql/docs/mysql/create-instance)\n- [Configure Managed Connection Pooling](/sql/docs/mysql/configure-mcp)"]]