# FATAL：抱歉，客户端数量过多（RDS Proxy 连接限制已超出）

- **ID:** `aws/rds-proxy-connection-limit-exceeded`
- **领域:** aws
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

RDS Proxy 已达到最大并发连接数限制，通常是由于连接泄漏或代理容量不足。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| RDS Proxy 1.0.0 | active | — | — |
| PostgreSQL 13.7 | active | — | — |
| MySQL 8.0.33 | active | — | — |

## 解决方案

1. ```
   在代理设置中增加 RDS Proxy 的 MaxConnectionsPercent（控制台或使用 CLI 'aws rds modify-db-proxy --db-proxy-name myproxy --max-connections-percent 100'）。这允许代理根据数据库实例的 max_connections 按比例处理更多连接。
   ```
2. ```
   修复应用程序中的连接泄漏：确保在所有代码路径中正确关闭数据库连接（例如，使用连接池，设置 'maxLifetime' 和 'idleTimeout'）。使用像 HikariCP（Java）或 pgBouncer（PostgreSQL）这样的连接池库。
   ```

## 无效尝试

- **** — Increasing the database instance max_connections without adjusting RDS Proxy's MaxConnectionsPercent parameter still leaves the proxy as the bottleneck. (60% 失败率)
- **** — Restarting the RDS Proxy doesn't solve the underlying issue of connection leaks from the application; connections will quickly exhaust the limit again. (40% 失败率)
