MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
7k stars 404 forks source link

RDS Proxy Pinning #1153

Open dbfreem opened 6 months ago

dbfreem commented 6 months ago

I am using asyncpg to query an postgres rds cluster. In my app I use asyncpg connection pools to aquire a connection and query the DB. I recently stood up an RDS Proxy in front of my RDS Cluster and I see almost 100% pinning because of the reset query used by asyncpg. I keep seeing the below message in my RDS Proxy logs for the pinned connections.

Consider moving session configuration to the proxy's initialization query. Digest: "select pg_advisory_unlock_all(); close all; unlisten *; reset all;".

Has anyone else run into connection pinning in RDS Proxy? I feel like the correct approach is not what is mentioned in the logs.

Thanks in advance :)

hieupng commented 3 months ago

This might help with your case.