{
  "id": "aws/rds-proxy-max-connections-exceeded",
  "signature": "FATAL: remaining connection slots are reserved for non-replication superuser connections (RDS Proxy)",
  "signature_zh": "致命错误：剩余的连接槽位保留给非复制超级用户连接（RDS Proxy）",
  "regex": "FATAL: remaining connection slots are reserved for non-replication superuser connections \\(RDS Proxy\\)",
  "domain": "aws",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The RDS Proxy has exhausted its maximum connection pool size (default 100) due to too many concurrent connections from applications, and the database instance itself is also at its max_connections limit.",
  "root_cause_type": "generic",
  "root_cause_zh": "RDS Proxy 已耗尽最大连接池大小（默认 100），原因是来自应用程序的并发连接过多，并且数据库实例本身也达到了 max_connections 限制。",
  "versions": [
    {
      "version": "RDS Proxy (2023-03-15)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PostgreSQL 13.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MySQL 8.0.35",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing only the RDS instance's max_connections without adjusting RDS Proxy's MaxConnectionsPercent will still cause the proxy to reject connections.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting the RDS Proxy without scaling the instance or reducing application connections will result in the same error immediately after restart.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Assuming the error is a database authentication issue and resetting credentials, which does not address the connection limit.",
      "fail_rate": 0.35,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the RDS Proxy's MaxConnectionsPercent and SessionPinningFilters in the proxy configuration via AWS Console or CLI: `aws rds modify-db-proxy --db-proxy-name my-proxy --max-connections-percent 120`. Also ensure the RDS instance's max_connections is at least 1.5x the proxy limit.",
      "success_rate": 0.9,
      "how": "Increase the RDS Proxy's MaxConnectionsPercent and SessionPinningFilters in the proxy configuration via AWS Console or CLI: `aws rds modify-db-proxy --db-proxy-name my-proxy --max-connections-percent 120`. Also ensure the RDS instance's max_connections is at least 1.5x the proxy limit.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement connection pooling in the application using a library like HikariCP (Java) or pgBouncer (PostgreSQL) to reduce the number of concurrent connections to the proxy. Example: set `maximumPoolSize=10` in HikariCP config.",
      "success_rate": 0.85,
      "how": "Implement connection pooling in the application using a library like HikariCP (Java) or pgBouncer (PostgreSQL) to reduce the number of concurrent connections to the proxy. Example: set `maximumPoolSize=10` in HikariCP config.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Monitor active connections using CloudWatch metrics for RDS Proxy (e.g., 'DatabaseConnections') and scale the DB instance to a larger size if needed.",
      "success_rate": 0.8,
      "how": "Monitor active connections using CloudWatch metrics for RDS Proxy (e.g., 'DatabaseConnections') and scale the DB instance to a larger size if needed.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过 AWS 控制台或 CLI 增加 RDS Proxy 的 MaxConnectionsPercent 和 SessionPinningFilters：`aws rds modify-db-proxy --db-proxy-name my-proxy --max-connections-percent 120`。同时确保 RDS 实例的 max_connections 至少是代理限制的 1.5 倍。",
    "在应用程序中使用连接池库（如 Java 的 HikariCP 或 PostgreSQL 的 pgBouncer）来减少对代理的并发连接数。例如：在 HikariCP 配置中设置 `maximumPoolSize=10`。",
    "使用 RDS Proxy 的 CloudWatch 指标（例如 'DatabaseConnections'）监控活动连接，并在需要时将数据库实例扩展到更大的尺寸。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}