Answer: Keep replicas × `store.max_connections` at or below the connections the database has left for the gateway, where each replica opens up to `store.max_connections` Postgres connections, five by default. For example, an autoscaling maximum of six plus two extra rolling-update replicas with the default pool of five needs (6 + 2) × 5 = 40 connections, which fits a database with `max_connections` of 50 and two connections held by other clients (50 − 3 − 2 = 45 left). Status: Confirmed Entry: tool/claude-code/admin-and-enterprise/size-postgres-connection-pool Revision: 3 Digest: sha256:d4dcb956e58205ea (changes whenever the content changes) Timeline: Created: 2026-11-13T03:03:27Z Last changed: 2026-11-20T12:18:38Z (superuser_reserved_connections default: — → three) Last verified: 2026-11-20T12:18:38Z Next check: 2026-11-21T12:18:38Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of Default pool size per replica | five | connections | [1] | 2026-11-20 Sizing rule | Keep replicas × `store.max_connections` at or below the connections the database has left for the gateway | | [1] | 2026-11-20 Example total connections | (6 + 2) × 5 = 40 | connections | [1] | 2026-11-20 Example connections left | 50 − 3 − 2 = 45 | connections | [1] | 2026-11-20 superuser_reserved_connections default | three | connections | [1] | 2026-11-20 Sources: [1] Anthropic. "Claude apps gateway deployment and operations". https://code.claude.com/docs/en/claude-apps-gateway-deploy.md Role: primary. Accessed: 2026-11-20T12:18:38Z Quote: "Postgres connections, five by default" (Supports: Default pool size per replica) Quote: "Keep replicas × `store.max_connections` at or below the connections the database has left for the gateway" (Supports: Sizing rule) Quote: "That needs (6 + 2) × 5 = 40 connections." (Supports: Example total connections) Quote: "has 50 − 3 − 2 = 45 left, so the total fits" (Supports: Example connections left) Quote: "PostgreSQL reserves `superuser_reserved_connections`, three by default." (Supports: superuser_reserved_connections default) Published: 2026-11-20T03:01:05Z Snapshot SHA-256: 3a870086a04bbb73920b2d92ea008ab10ca7bdf926ac44e1a602ca76fc32fda3 (captured 2026-11-20T12:18:38Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:18:38Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:18:38Z Last attempt: 2026-11-20T12:18:38Z Notes and limitations: Extracted automatically from a single official source (section "Size the connection pool"). Related: https://latestn.com/tool/claude-code/admin-and-enterprise/stop-user-installed-mods How do I stop user-installed mods from loading in Claude Code for my organization? https://latestn.com/tool/claude-code/admin-and-enterprise/strict-mode-plugin-entries What does strict mode do for plugin entries in a Claude Code marketplace? https://latestn.com/tool/claude-code/admin-and-enterprise/teams-vs-enterprise-deployment What is the difference between Claude for Teams and Claude for Enterprise for deploying Claude Code? https://latestn.com/tool/claude-code/admin-and-enterprise/set-team-spend-limits How do I set spend limits for my team in Claude Code? https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-claude-tag-for-team How do I set up Claude Tag for my whole team as an administrator? https://latestn.com/tool/claude-code/admin-and-enterprise/set-up-environment-and-runner How do I set up a self-hosted environment and runner in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:18:38Z | changed | superuser_reserved_connections default: — → three | [1] 2026-11-20T12:18:38Z | changed | PostgreSQL reserved connections default: three → — | [1] 2026-11-17T12:23:12Z | changed | PostgreSQL reserved connections default: — → three | [1] 2026-11-17T12:23:12Z | changed | superuser_reserved_connections default: three → — | [1] 2026-11-13T03:03:27Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool POST: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I size the Postgres connection pool for a Claude apps gateway? Revision 3, last verified 2026-11-20T12:18:38Z. https://latestn.com/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool (accessed 2026-11-21T09:59:29Z). @misc{LatestN_tool_claude_code_admin_and_enterprise_size_postgres_connection_pool_r3, title = {How do I size the Postgres connection pool for a Claude apps gateway?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool}}, note = {Revision 3; digest sha256:d4dcb956e58205ea; last verified 2026-11-20T12:18:38Z; accessed 2026-11-21T09:59:29Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/admin-and-enterprise/size-postgres-connection-pool