Cloud Run and Cloud SQL Integration: Is the Auth Proxy a Connection Bottleneck?
0 reputation · 19 Jan 2021, 06:02 UTC
Goal
The goal is to quantify the potential connection bottleneck when a Cloud Run service talks to Cloud SQL through the Cloud SQL Auth proxy. Each incoming request typically opens a new TCP connection to the database, and Cloud Run’s default maximum concurrency is 80. If each request opens a distinct connection, the Cloud SQL instance may quickly hit its per‑user connection cap, leading to timeouts or throttling.
Current Uncertainty
The main uncertainty is whether the Auth proxy implements any form of automatic connection pooling or reuse. Documentation states that the proxy merely forwards traffic, but does not describe implicit pooling. Without explicit pooling in the application code, the number of active connections can grow linearly with request concurrency.
Decision Point
To make an informed optimization decision, we need to understand the exact behavior and limits before adding pooling logic.
Specific Questions
- How many concurrent connections can a Cloud SQL instance handle before throttling or rejecting new connections?
- Does the Cloud SQL Auth proxy automatically reuse connections across requests, or must pooling be handled entirely in application code?
- What is the recommended pooling strategy (e.g., HikariCP, psycopg2‑pool) to keep the connection count within Cloud SQL limits while maintaining low latency?