Cette page décrit ce qu'est le pooling de connexions géré et comment l'utiliser pour optimiser la gestion des connexions de base de données pour vos instances Cloud SQL à l'aide du pooling.
Le pooling de connexions géré vous permet de faire évoluer vos charges de travail en optimisant l'utilisation des ressources et la latence de connexion pour vos instances Cloud SQL à l'aide du pooling.
Le regroupement de connexions géré crée un pool de threads pour gérer les requêtes entrantes. Cela permet d'améliorer considérablement les performances, en particulier pour les connexions mises à l'échelle, en absorbant les pics de connexion soudains sans surcharger le serveur avec une augmentation du nombre de threads.
Pour utiliser le pooling de connexions géré, votre instance doit répondre aux exigences suivantes :
Votre instance doit être une instance Cloud SQL Enterprise Plus.
Le regroupement de connexions géré nécessite une version de maintenance minimale de MYSQL_$version.R20250531.01_10. Pour en savoir plus sur la maintenance en libre-service, consultez Effectuer la maintenance en libre-service.
L'option max_pool_size contrôle le niveau de simultanéité pour le regroupement de connexions géré.
La valeur par défaut dépend du nombre de cœurs de processeur virtuel dans la configuration de la machine de votre instance.
Limites
Lorsque vous utilisez le pooling de connexions géré avec vos instances Cloud SQL Enterprise Plus, tenez compte des limites suivantes :
L'activation du pooling de connexions géré sur une instance existante entraîne le redémarrage de la base de données.
Lorsque le pool de connexions géré est activé pour votre instance, la valeur de la métrique thread_cache_size est définie par défaut sur 0.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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)"]]