Configure Managed Connection Pooling
This page describes how to enable, configure, and monitor Managed Connection Pooling inyour Cloud SQL instances.
Managed Connection Pooling lets you scale your workloads by optimizing resourceutilization and connection latency for your instances using pooling. Fordetailed information about Managed Connection Pooling and how to use it for yourinstances, seeManaged Connection Pooling overview.
Before you begin
- Confirm that your instance meets allrequirementsto use Managed Connection Pooling.
- If you're usinggcloud CLI, then confirm that yourgcloud CLIversion is
515.0.0or later. - Confirm that your instance is using the new Cloud SQL networkarchitecture. If your instance is still using the old network architecture, thenupgrade to the new network architecture.
- Confirm that your instance has the required server connections per vCPUallocated in the
max_connectionsflag for your database's configuration settings. For moreinformation, seeServer connections used by Managed Connection Pooling.
Enable Managed Connection Pooling
You can enable Managed Connection Pooling for an instance at time of creation,or edit an existing instance to enable it.
Enable Managed Connection Pooling for a new instance
To create a new instance with Managed Connection Pooling enabled, seeCreate instances. You can enableManaged Connection Pooling for a new instance usinggcloud CLI or theCloud SQL API only.
Enable Managed Connection Pooling for an existing instance
To enable Managed Connection Pooling for an existing instance, do the following:
Console
In the Google Cloud console, go to theCloud SQL Instances page.
Find the instance you want to enable Managed Connection Pooling for.To open the Overview page of the instance, click the instance name.
ClickEdit.
UnderCustomize your instance, expandConnections.
To enable Managed Connection Pooling, check the box forEnable Managed Connection Pool.
ClickSave.
Note: This will cause your instance to restart.
gcloud
Use thegcloud sql instances command to enable Managed Connection Pooling.
gcloud sql instances patchINSTANCE_NAME \ --enable-connection-poolingReplace the following:
INSTANCE_NAME: the name of the Cloud SQL instance.
REST v1
Use the following command and setconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "connectionPoolingEnabled": true } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}REST v1beta4
Use the following command and setconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "connectionPoolingEnabled": true } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}Terraform
Use the followingTerraform resource:
resource "google_sql_database_instance" "postgres_managed_connection_pooling_enable" { name = "postgres-instance-managed-connection-pooling-enable" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false settings { tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true # Set to true here } }}Modify Managed Connection Pooling for an instance
After you enable Managed Connection Pooling, you can customizeManaged Connection Pooling to meet the needs of your instance using advancedconfiguration options. These configuration options are called Managed Connection Poolingpool flags. Configurations added to Managed Connection Poolingare applied to all connection poolers used by the instance. For moreinformation on the advanced configuration options, their default values, andranges, seeAdvanced configurations options.
To modify the advanced Managed Connection Pooling configuration options for aninstance, do the following:
Console
In the Google Cloud console, go to theCloud SQL Instances page.
Find the instance you want to enable Managed Connection Pooling for.To open the Overview page of the instance, click the instance name.
ClickEdit.
UnderCustomize your instance, expandConnections.
UnderManaged connection pool, expandAdvanced pooling options.
Modify the advanced pooling options that you want to update.
ClickSave.
gcloud
Use thegcloud sql instances command to modify configuration options.
gcloud sql instances patchINSTANCE_NAME \ --connection-pool-flags=CONFIGURATION_NAME=CONFIGURATION_VALUEReplace the following:
INSTANCE_NAME: the name of the Cloud SQL instance.CONFIGURATION_NAME: the name of the configuration option. For a list of all advanced configuration options, seeAdvanced configurations options.CONFIGURATION_VALUE: the new value for the selected configuration option.
REST v1
To modify Managed Connection PoolingAdvanced configurations, use the following command and setConnectionPoolConfig:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "flags": [ { "name": "CONFIGURATION_NAME", "value":"CONFIGURATION_VALUE" } ] } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}REST v1beta4
To modify Managed Connection PoolingAdvanced configurations, use the following command and setConnectionPoolConfig:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "flags": [ { "name": "CONFIGURATION_NAME", "value":"CONFIGURATION_VALUE" } ] } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}Terraform
To modify Managed Connection PoolingAdvanced configurations, use the followingTerraform resource:
resource "google_sql_database_instance" "postgres_managed_connection_pooling_modify" { name = "postgres-instance-managed-connection-pooling-modify" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false settings { tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true flags { name = "max_pool_size" # Modify the value of an existing flag value = "10" } } }}Disable Managed Connection Pooling for an instance
You can disable Managed Connection Pooling for an existing instance using theGoogle Cloud console,gcloud CLI, or the Cloud SQL API.
To disable Managed Connection Pooling for an instance, do the following:
Console
In the Google Cloud console, go to theCloud SQL Instances page.
Find the instance you want to disable Managed Connection Pooling for.To open the Overview page of the instance, click the instance name.
ClickEdit.
UnderCustomize your instance, expandConnections.
To disable Managed Connection Pooling, clear the box forEnable Managed Connection Pool.
ClickSave.
Note: This will cause your instance to restart.
gcloud
Use thegcloud sql instances command to disable Managed Connection Pooling.
gcloud sql instances patchINSTANCE_NAME \ --no-enable-connection-poolingReplace the following:
PROJECT_ID: the name of the Cloud SQL instance.
REST v1
To disable Managed Connection Pooling for an instance, use the following command and setconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "connectionPoolingEnabled": false } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}REST v1beta4
To disable Managed Connection Pooling for an instance, use the following command and setconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID
- INSTANCE_ID: the instance ID
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID
Request JSON body:
{ "settings": { "connectionPoolConfig": { "connectionPoolingEnabled": false } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/instances/INSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-16T02:32:12.281Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/sql/v1/projects/PROJECT_ID/operations/OPERATION_ID", "targetProject": "PROJECT_ID"}Terraform
To disable Managed Connection Pooling for an instance, use the followingTerraform resource:
resource "google_sql_database_instance" "postgres_managed_connection_pooling_disable" { name = "postgres-instance-managed-connection-pooling-disable" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false settings { tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { # Set to false to disable Managed Connection Pooling. You can also remove the block entirely. connection_pooling_enabled = false } }}View Managed Connection Pooling status for an instance
You can view the status of Managed Connection Pooling for an instance usingthe Google Cloud console,gcloud CLI, or the Cloud SQL API.
To view the status of Managed Connection Pooling for a Cloud SQL Enterprise Plus edition instance, do thefollowing:
Console
In the Google Cloud console, go to theCloud SQL Instances page.
Find the instance you want to view the Managed Connection Pooling status for.To open the Overview page of the instance, click the instance name.
TheConnections section shows whether Managed Connection Pooling isenabled or disabled.
gcloud
Use thegcloud sql instances describe command to view Managed Connection Pooling status for an instance:
gcloud sql instances describeINSTANCE_NAME --format="value(settings.connectionPoolConfig.connectionPoolingEnabled)"Replace the following:
PROJECT_ID: the name of the Cloud SQL instance.If Managed Connection Pooling is enabled, the following response is returned:
connectionPoolingEnabled: true
REST v1
To view the status of Managed Connection Pooling for your Cloud SQL instance, use the following command and look forconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID orproject number of the Google Cloud project that contains the instance.
- INSTANCE_NAME: the name of the Cloud SQL instance. If this instance hasPrivate Service Connect enabled for it, thenPrivate Service Connect endpoints in VPC networks can connect to it.
HTTP method and URL:
GET https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_NAME"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#instance", "state": "RUNNABLE", "databaseVersion": "POSTGRES_13", "settings": { "authorizedGaeApplications": [], "tier": "db-custom-2-7680", "kind": "sql#settings", "availabilityType": "REGIONAL", "pricingPlan": "PER_USE", "replicationType": "SYNCHRONOUS", "activationPolicy": "ALWAYS", "ipConfiguration": { "authorizedNetworks": [], "pscConfig": { "allowedConsumerProjects": [ "ALLOWED_PROJECTS" ], "pscEnabled": true }, "ipv4Enabled": false }, ... "createTime": "2023-06-14T18:48:34.975Z", "sqlNetworkArchitecture": "NEW_NETWORK_ARCHITECTURE", "pscServiceAttachmentLink": "projects/PROJECT_ID/regions/REGION_NAME/serviceAttachments/SERVICE_ATTACHMENT_ID", "dnsName": "DNS_NAME"}REST v1beta4
To view the status of Managed Connection Pooling for your Cloud SQL instance, use the following command and look forconnectionPoolingEnabled:
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID orproject number of the Google Cloud project that contains the instance.
- INSTANCE_NAME: the name of the Cloud SQL instance. If this instance hasPrivate Service Connect enabled for it, thenPrivate Service Connect endpoints in VPC networks can connect to it.
HTTP method and URL:
GET https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_NAME"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT_ID/instances/INSTANCE_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "sql#instance", "state": "RUNNABLE", "databaseVersion": "POSTGRES_13", "settings": { "authorizedGaeApplications": [], "tier": "db-custom-2-7680", "kind": "sql#settings", "availabilityType": "REGIONAL", "pricingPlan": "PER_USE", "replicationType": "SYNCHRONOUS", "activationPolicy": "ALWAYS", "ipConfiguration": { "authorizedNetworks": [], "pscConfig": { "allowedConsumerProjects": [ "ALLOWED_PROJECTS" ], "pscEnabled": true }, "ipv4Enabled": false }, ... "createTime": "2023-06-14T18:48:34.975Z", "sqlNetworkArchitecture": "NEW_NETWORK_ARCHITECTURE", "pscServiceAttachmentLink": "projects/PROJECT_ID/regions/REGION_NAME/serviceAttachments/SERVICE_ATTACHMENT_ID", "dnsName": "DNS_NAME"}Monitor Managed Connection Pooling
You canmonitor howManaged Connection Pooling is running on your Cloud SQL instances using thefollowing Cloud SQL Managed Connection Pooling metrics:
| Metric name | Description |
|---|---|
| num_pools | The total number of connection pools per database. |
| client_connection | Tracks the connection count by the status of the client connection. The statuses included in this metric are:
|
| server_connections | Tracks the server connections count by the status of the server connection. The statuses included in this metric are:
|
| client_connections_avg_wait_time | The average time spent by all clients in waiting state for a server. |
For more information about these metrics, seeCloud SQL metrics. To view thesemetrics using the Google Cloud console, seeView metrics on the Cloud SQL instance overview page.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-24 UTC.