이 페이지에서는 관리형 연결 풀링에 대해 소개하고 Cloud SQL 인스턴스에서 이를 사용하는 방법을 설명합니다.
관리형 연결 풀링을 사용하면 풀링을 사용해 PostgreSQL용 Cloud SQL 인스턴스의 리소스 사용률과 연결 지연 시간을 최적화하여 워크로드를 확장할 수 있습니다.
관리형 연결 풀링은 가능한 경우 수신 요청에 서버 연결을 동적으로 할당합니다. 이렇게 하면 연결 급증을 흡수하고 기존 데이터베이스 연결을 재사용하여 특히 확장된 연결의 성능이 크게 향상됩니다. 관리형 연결 풀링은 특정 데이터베이스에 연결하는 대신 풀러 클러스터에 연결하여 워크로드의 연결 시간을 단축하고 확장성을 제공합니다. 사용되는 풀러 수는 인스턴스의 vCPU 코어 수를 기반으로 합니다.
모든 트랜잭션 워크로드에 관리형 연결 풀링을 사용할 수 있지만, 관리형 연결 풀링은 단기 지속 연결이 포함된 애플리케이션이나 연결 급증을 유발하는 애플리케이션에서 가장 높은 처리량과 지연 시간 이점을 제공합니다.
장기 지속 연결의 경우 관리형 연결 풀을 사용하는 연결 성능이 직접 연결을 사용할 때보다 약간 낮을 수 있습니다. 이러한 경우 연결 수가 매우 많으면 관리형 연결 풀링에서 연결 확장 기능을 제공합니다. 하지만 일반적으로 장기 지속 연결을 설정하는 애플리케이션의 경우 인스턴스에 직접 연결을 대신 사용할 수 있습니다.
관리형 연결 풀링을 사용 설정하는 방법에 대한 자세한 내용은 관리형 연결 풀링 구성을 참조하세요.
요구사항
관리형 연결 풀링을 사용하려면 인스턴스가 다음 요구사항을 충족해야 합니다.
인스턴스가 Cloud SQL Enterprise Plus 버전 인스턴스여야 합니다.
직접 연결 또는 Cloud SQL 인증 프록시만 사용하여 인스턴스에 연결해야 합니다.
유효한 사용자 이름과 비밀번호를 사용하여 인스턴스에 연결해야 합니다. 관리형 연결 풀링을 사용하는 경우 IAM 및 IAM 그룹 사용자는 지원되지 않습니다.
관리형 연결 풀링을 사용하려면 유지보수 버전 번호가 POSTGRES_$version.R20250302.00_04 이상이어야 합니다. 자세한 내용은 셀프서비스 유지보수 실행을 참조하세요.
Cloud SQL 인스턴스의 관리형 연결 풀링에서 사용되는 포트
관리형 연결 풀링을 사용 설정하면 Cloud SQL 인스턴스에서 데이터베이스 트래픽을 처리하는 데 사용되는 포트가 변경됩니다. 관리형 연결 풀링에서 사용하는 포트는 다음과 같습니다.
TCP 포트 5432: Postgres 데이터베이스 서버의 직접 연결에 사용됩니다. psql 클라이언트를 사용하여 직접 연결할 때 사용되는 기본 포트 번호입니다.
TCP 포트 6432: 관리형 연결 풀링 풀러의 직접 연결에 사용됩니다. 이 포트를 사용하여 연결하려면 psql 클라이언트를 사용하여 직접 연결할 때 psql -p 6432를 지정하세요.
TCP 포트 3307: 관리형 연결 풀링 풀러에 의한 Cloud SQL 인증 프록시 전용 연결에 사용됩니다. Cloud SQL 인증 프록시를 사용하여 관리형 연결 풀링 풀러에 연결하는 경우 이 포트 번호가 Cloud SQL 인증 프록시 클라이언트로 구성되며 변경할 수 없습니다.
사용 가능한 구성 옵션
관리형 연결 풀링은 pool_mode 매개변수를 사용하여 설정할 수 있는 다음과 같은 풀링 옵션을 제공합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-19(UTC)"],[],[],null,["# Managed Connection Pooling overview\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/managed-connection-pooling \"View this page for the MySQL database engine\") \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview\n| --- [Managed Connection Pooling](/sql/docs/postgres/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 PostgreSQL instances using pooling.\n\nManaged Connection Pooling dynamically assigns server connections to\nincoming requests when possible. This delivers significant performance\nimprovements, especially for scaled connections, by absorbing sudden\nconnection spikes and reusing existing database connections. Instead of\nconnecting to a particular database, Managed Connection Pooling connects to a\ncluster of poolers, which provide shorter connection times and scalability\nfor your workloads. The number of poolers used is based on the number of vCPU\ncores of your instance.\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/postgres/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- You must be connected to your instance using a direct connection, or the Cloud SQL Auth Proxy only.\n- You must be connected to your instance using a valid username and password. IAM and IAM group users aren't supported when using Managed Connection Pooling.\n- Your instance must either be set up for [private service access](/sql/docs/postgres/private-ip#set_up_private_services_access_for_your_network), use public IP, or be a new instance with [Private Service Connect](/sql/docs/postgres/about-private-service-connect) enabled.\n- Your instance must use the new [Cloud SQL network architecture](/sql/docs/postgres/upgrade-cloud-sql-instance-new-network-architecture).\n- Managed Connection Pooling requires a minimum maintenance version number of `POSTGRES_$version.R20250302.00_04`. For more information, see [Perform self-service maintenance](/sql/docs/postgres/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. The ports used by Managed Connection Pooling are as follows:\n\n- **TCP port 5432** : used for direct connections by the Postgres database server. This is the default port number used when [directly connecting using psql client](/sql/docs/postgres/connect-admin-ip#connect).\n- **TCP port 6432** : used for direct connections by the Managed Connection Pooling pooler. To connect using this port, specify `psql -p 6432` when [directly connecting using psql client](/sql/docs/postgres/connect-admin-ip#connect).\n- **TCP port 3307**: used for the Cloud SQL Auth Proxy only connections by a Managed Connection Pooling pooler. When you use Cloud SQL Auth Proxy to connect to Managed Connection Pooling pooler, this port number is configured with the Cloud SQL Auth Proxy client and can't be changed.\n\nAvailable configuration options\n-------------------------------\n\nManaged Connection Pooling offers the following pooling options that you can set using the `pool_mode` parameter:\n\n\u003cbr /\u003e\n\n- `transaction` (default): pools connections at a transaction level.\n- `session`: pools connections at a session level.\n\n| **Note:** The maximum number of server connections used by the pooler in Managed Connection Pooling is limited by the `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](/sql/docs/quotas#maximum_concurrent_connections). To modify the `max_connections` database configuration flag for your instance, see [Configure database flags](/sql/docs/postgres/flags#config).\n\nYou can also\n[customize Managed Connection Pooling](/sql/docs/postgres/configure-mcp#modify-mcp)\nby using the following configuration parameters:\n\n- `max_pool_size`: the maximum size of the connection pool. The default value is 50 connections.\n- `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.\n- `max_client_connections`: the maximum number of connections allowed for your instance. The default value is 5,000 connections.\n- `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.\n- `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.\n- `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.\n- `max_prepared_statements`: the maximum number of protocol-level named prepared statements commands supported in transaction pooling mode. The default value is 0 statements.\n- `ignore_startup_parameters`: the parameters you want ignored, that aren't tracked in Managed Connection Pooling's startup packets by default.\n- `server_lifetime`: the maximum time a server connection is unused before Managed Connection Pooling closes it. The default value is 3600 seconds.\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- Managed Connection Pooling can only be used with Cloud SQL Auth Proxy version 2.15.2 and later.\n- If you're using the Cloud SQL Go Language Connector, then we recommend a minimum Go version of `1.24`. If you use Go version 1.23 or earlier, then you might experience limitations on performance when using Managed Connection Pooling.\n- If you're using Managed Connection Pooling in `transaction` pooling mode, then\n the following SQL features aren't supported:\n\n - `SET/RESET`\n - `LISTEN`\n - `WITH HOLD CURSOR`\n - `PREPARE/DEALLOCATE`\n - `PRESERVE/DELETE ROW` temp tables\n - `LOAD`\n - Session-level advisory locks\n- If you're using the\n [asyncpg database interface library](https://magicstack.github.io/asyncpg/current/)\n for Managed Connection Pooling pooler on port 3307 and 6432, then you must update the\n `max_prepared_statements` to a value larger than 0 to enable support for\n prepared statements in Managed Connection Pooling pooler.\n\n- If you're using Cloud SQL for PostgreSQL version 17, then the\n `sslnegotiation=direct` option isn't supported.\n\n- Client IP tracking isn't supported with Managed Connection Pooling. If you enable\n *store client IP addresses* in [query insights](/sql/docs/postgres/using-query-insights),\n then client IP addresses are displayed as `local` instead of the IP address\n itself.\n\nWhat's next\n-----------\n\n- [Create an instance](/sql/docs/postgres/create-instance)\n- [Configure Managed Connection Pooling](/sql/docs/postgres/configure-mcp)"]]