You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The creator argument (same for async_creator) for SQLAlchemy is called on each new database connection. This means that initializing a Cloud SQL or AlloyDB Connector object within the get_conn is creating a new Connector for each connection pool connection and not sharing a single Connector across all connections.
For heavy usage this would lead to Cloud SQL or AlloyDB quotas being exhausted and for applications to begin to error.
A more efficient use would be to create a single Connector outside of get_conn so that it can be shared across all connections.
The text was updated successfully, but these errors were encountered:
The Cloud SQL and AlloyDB datastore providers could improve their use of connection pools, leading to more efficient quota and resource consumption.
genai-databases-retrieval-app/retrieval_service/datastore/providers/cloudsql_postgres.py
Lines 57 to 73 in 6987280
The
creator
argument (same forasync_creator
) for SQLAlchemy is called on each new database connection. This means that initializing a Cloud SQL or AlloyDBConnector
object within theget_conn
is creating a new Connector for each connection pool connection and not sharing a singleConnector
across all connections.For heavy usage this would lead to Cloud SQL or AlloyDB quotas being exhausted and for applications to begin to error.
A more efficient use would be to create a single
Connector
outside ofget_conn
so that it can be shared across all connections.The text was updated successfully, but these errors were encountered: