{
  "id": "cloud/aws-rds-proxy-connection-pool-exhausted",
  "signature": "RDSProxy: Connection pool exhausted for database 'mydb'",
  "signature_zh": "RDSProxy：数据库'mydb'的连接池已耗尽",
  "regex": "RDSProxy.*Connection pool exhausted for database.*",
  "domain": "cloud",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "RDS Proxy's maximum connection pool size for the target database is reached, often due to too many concurrent connections or long-running queries holding connections open.",
  "root_cause_type": "generic",
  "root_cause_zh": "RDS Proxy针对目标数据库的最大连接池大小已满，通常是由于并发连接过多或长时间运行的查询占用连接未释放。",
  "versions": [
    {
      "version": "RDS Proxy 1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Aurora MySQL 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Aurora PostgreSQL 15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "RDS for MySQL 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "RDS Proxy pool size is limited by the database's max_connections; increasing proxy percent alone does not help if the database limit is reached.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting clears the pool temporarily, but the application will quickly exhaust it again if connections are not closed properly.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Multiple proxy endpoints share the same underlying database connection limit; this only distributes load but does not increase total pool size.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase RDS Proxy's MaxConnectionsPercent and SessionPinningFilters in the proxy target group: `aws rds modify-db-proxy-target-group --db-proxy-name my-proxy --target-group-name default --connection-pool-config MaxConnectionsPercent=90,SessionPinningFilters=[\"EXCLUDE_VARIABLE_SETS\"]`. Also increase database max_connections: `aws rds modify-db-instance --db-instance-identifier my-db --db-parameter-group-name custom-params` with max_connections=500.",
      "success_rate": 0.85,
      "how": "Increase RDS Proxy's MaxConnectionsPercent and SessionPinningFilters in the proxy target group: `aws rds modify-db-proxy-target-group --db-proxy-name my-proxy --target-group-name default --connection-pool-config MaxConnectionsPercent=90,SessionPinningFilters=[\"EXCLUDE_VARIABLE_SETS\"]`. Also increase database max_connections: `aws rds modify-db-instance --db-instance-identifier my-db --db-parameter-group-name custom-params` with max_connections=500.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Optimize application code to close connections promptly using connection pooling libraries (e.g., HikariCP with maxLifetime=300000 and idleTimeout=600000). Set connection timeout in AWS Lambda: `import pymysql; conn = pymysql.connect(..., connect_timeout=5, read_timeout=30)`.",
      "success_rate": 0.9,
      "how": "Optimize application code to close connections promptly using connection pooling libraries (e.g., HikariCP with maxLifetime=300000 and idleTimeout=600000). Set connection timeout in AWS Lambda: `import pymysql; conn = pymysql.connect(..., connect_timeout=5, read_timeout=30)`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase RDS Proxy's MaxConnectionsPercent and SessionPinningFilters in the proxy target group: `aws rds modify-db-proxy-target-group --db-proxy-name my-proxy --target-group-name default --connection-pool-config MaxConnectionsPercent=90,SessionPinningFilters=[\"EXCLUDE_VARIABLE_SETS\"]`. Also increase database max_connections: `aws rds modify-db-instance --db-instance-identifier my-db --db-parameter-group-name custom-params` with max_connections=500.",
    "Optimize application code to close connections promptly using connection pooling libraries (e.g., HikariCP with maxLifetime=300000 and idleTimeout=600000). Set connection timeout in AWS Lambda: `import pymysql; conn = pymysql.connect(..., connect_timeout=5, read_timeout=30)`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html#rds-proxy-connection-pool",
  "official_doc_section": null,
  "error_code": "ConnectionPoolExhausted",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}