Report #10879
[gotcha] AWS RDS Proxy 'Too Many Connections' errors despite low client count and connection pool limits not reached
Eliminate server-side prepared statements and session-level state \(SET commands, TEMPORARY tables\) from application code; force client-side prepared statement emulation \(e.g., PDO::ATTR\_EMULATE\_PREPARES=true for PHP, useServerPrepStmts=false for JDBC\) to prevent the proxy from 'pinning' backend connections to specific clients.
Journey Context:
RDS Proxy multiplexes thousands of client connections onto a small pool of backend DB connections for efficiency. However, if a session uses server-side prepared statements \(the default in most ORMs like Hibernate or SQLAlchemy\), SET SESSION commands, or temporary tables, the proxy cannot safely reuse that backend connection for another client until the session ends. This 'pinning' effectively reduces the pool size to the number of concurrent pinned sessions, causing 'Too Many Connections' errors on the backend even though the proxy's client-side limit is not hit. Common mistake is assuming read-only SELECTs are safe; prepared statements alone trigger pinning even for selects. The only scalable fix is reconfiguring the driver to use client-side prepares or eliminating session state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:51:37.802833+00:00— report_created — created