Stay organized with collections Save and categorize content based on your preferences.
MySQL | PostgreSQL | SQL ServerPreview — Managed Connection Pooling
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. You can process personal data for this feature as outlined in the Cloud 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 the launch stage descriptions.
This page describes what Managed Connection Pooling is and how to use it with your Cloud SQL instances.
Managed Connection Pooling lets you scale your workloads by optimizing resource utilization and connection latency for your Cloud SQL for PostgreSQL instances using pooling. Managed Connection Pooling dynamically assigns server connections to incoming requests when possible. This delivers significant performance improvements, especially for scaled connections, by absorbing sudden connection spikes and reusing existing database connections. Instead of connecting to a particular database, Managed Connection Pooling connects to a cluster of poolers, which provide shorter connection times and scalability for your workloads. The number of poolers used is based on the number of vCPU cores of your instance.
While you can use Managed Connection Pooling for any transactional workloads, Managed Connection Pooling provides the most throughput and latency benefit with applications that contain short-lived connections, or applications that result in a connection surge.
For long-lived connections, the connection performance using Managed Connection Pooling can be slightly lower than when using a direct connection. In this case, Managed Connection Pooling provides connection scaling when the number of connections is very high. However, for applications that typically establish long-lived connections, you might use direct connections to your instance instead.
For more information on how to enable Managed Connection Pooling, see Configure Managed Connection Pooling.
RequirementsTo use Managed Connection Pooling, your instance must meet the following requirements:
POSTGRES_$version.R20250302.00_04
. For more information, see Self-service maintenance.When you enable Managed Connection Pooling, the ports used by Cloud SQL instances to serve database traffic change. The ports used by Managed Connection Pooling are as follows:
psql -p 6432
when directly connecting using psql client.Managed Connection Pooling offers the following pooling options that you can set using the
pool_mode
parameter:
transaction
(default): pools connections at a transaction level.session
: pools connections at a session level.max_connections
database configuration. Cloud SQL recommends adjusting this value based on your instance's workload requirements and the database instance size. For more information about the max_connections
flag, see Maximum concurrent connections. To modify the max_connections
database configuration flag for your instance, see Configure database flags.
You can also customize Managed Connection Pooling by using the following configuration parameters:
max_pool_size
: the maximum size of the connection pool. The default value is 50 connections.min_pool_size
: the threshold size of the connection pool. If the number of server connections is less than min_pool_size
, then add more server connections to the pool. The default value is 0 connections.max_client_connections
: the maximum number of connections allowed for your instance. The default value is 5,000 connections.client_connection_idle_timeout
: the time that a client-connection remains idle before it times out. This value can range from 0 to 2,147,483 seconds, and the default value is 0 seconds.server_connection_idle_timeout
: the time that a server connection remains idle before it times out. This value can range from 0 to 2,147,483 seconds, and the default value is 600 seconds.query_wait_timeout
: the time that a query waits until it times out. This value can range from 0 to 2,147,483 seconds, and the default value is 120 seconds.max_prepared_statements
: the maximum number of protocol-level named prepared statements commands supported in transaction pooling mode. The default value is 0.ignore_startup_parameters
: the parameters you want ignored, that aren't tracked in Managed Connection Pooling's startup packets by default.server_lifetime
: the maximum time a server connection is unused before Managed Connection Pooling closes it. The default value is 3600 seconds.Consider the following limitations when using Managed Connection Pooling with your Cloud SQL Enterprise Plus edition instances:
instance.update
API can't contain any other instance configuration updates.1.24
. If you use Go version 1.23 or earlier, then you might experience limitations on performance when using Managed Connection Pooling.If you're using Managed Connection Pooling in transaction
pooling mode, then the following SQL features aren't supported:
SET/RESET
LISTEN
WITH HOLD CURSOR
PREPARE/DEALLOCATE
PRESERVE/DELETE ROW
temp tablesLOAD
If you're using Cloud SQL for PostgreSQL version 17, then the sslnegotiation=direct
option isn't supported.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4