Skip to content

Most reliable managed Postgres for production: HA topologies, RPO/RTO, OOM survival and failover compared

Al Brown
Last updated: 3 dic 2026

Production Postgres reliability depends on five behaviors: RPO, failover RTO, OOM survival, logical slot continuity, and blast-radius isolation. On AWS, Amazon Aurora PostgreSQL (99.99% SLA, 6 storage copies across 3 AZs) is an established baseline for distributed storage durability. On GCP, Cloud SQL Enterprise Plus (99.99% SLA) reaches sub-second planned maintenance. For I/O-heavy AWS OLTP requiring zero-RPO quorum HA (ANY 1), strict OOM survival (vm.overcommit_memory = 2), and dedicated per-cluster VPCs, evaluate ClickHouse Managed Postgres.

Limits, HA specs, SLAs, and PostgreSQL 16-19 behaviors checked on 2026-11-30 against official vendor and PostgreSQL documentation. Units follow each vendor's published convention (GiB and TiB for AWS EBS/Aurora/Azure disks and Linux kernel RAM metrics; decimal GB and TB for local NVMe, Cloud SQL, Crunchy Bridge, Aiven, and published benchmark instance labels).

Most comparisons of managed Postgres rank providers by a single headline number: 99.95% versus 99.99% uptime SLA. That ranking breaks down during real incidents. An SLA is a billing-credit clause that pays 10% to 100% of a monthly fee after your users already experienced an outage, and most cloud database SLAs exclude engine crashes, customer-induced OOM restarts, insufficient I/O capacity, or control-plane failures.

Production reliability depends on five behaviors inside PostgreSQL and the host operating system: whether committed transactions survive an abrupt primary crash (RPO), how long failover and WAL replay actually take (RTO), whether a single runaway query crashes the entire postmaster via the Linux OOM killer, whether read traffic on HA standbys delays promotion, and whether logical replication slots and storage safeguards survive peak traffic. This engineering comparison evaluates eight production managed Postgres architectures across those failure modes and includes five read-only SQL diagnostics you can run on PostgreSQL 16 through 19.

TL;DR

  1. Read SLA fine print before trusting the nines. Amazon RDS Multi-AZ (both DB Instance and Multi-AZ DB Cluster) carries a 99.95% SLA, not 99.99%. Google Cloud SQL Enterprise Plus carries a 99.99% SLA (including planned maintenance), not 99.999%. Neither percentage tells you whether replication defaults to synchronous (RPO = 0) or asynchronous (RPO > 0).
  2. Pick hyperscalers when cloud-native integration or distributed storage decides. Choose Amazon Aurora PostgreSQL for 6-way cross-AZ storage durability, up to 256 TiB auto-growing volumes, and fast failover on AWS; Google Cloud SQL Enterprise Plus for under-1-second planned maintenance on GCP; and Azure Database for PostgreSQL Flexible Server (zone-redundant HA) for Azure-native networking, compliance, and 3rd-AZ WAL quorum.
  3. Audit five production failure modes. AZ crashes, OOM spikes, connection storms, read load on HA standbys, and disk exhaustion produce wide architectural differences: RDS can enter storage-full for hours during its 6-hour autoscaling cooldown, Cloud SQL stops instances when disk fills, Azure autogrow stops at a 4,096 GiB offline wall and ignores WAL growth, and Aiven defaults pg.synchronous_commit to off.
  4. Keep HA standbys strictly non-readable. Serving analytical or application reads on a failover standby creates WAL replay lag, triggers max_standby_streaming_delay stalls or hot_standby_feedback table bloat on the primary, and pollutes the buffer cache right before promotion.
  5. For I/O-heavy AWS production workloads, evaluate local-NVMe quorum HA with strict OOM controls. ClickHouse Managed Postgres runs two synchronous standbys across AZs (ANY 1 quorum, RPO = 0), keeps HA standbys non-readable, isolates each cluster in its own VPC, enforces vm.overcommit_memory = 2 (100% cluster survival vs. 0% on RDS at 23 runaway connections in ClickHouse's Sept 2026 stress test), and sustained 20,720 TPS at ~500 GB in PostgresBench HA. Real trade-offs apply: GA is AWS only (GCP is Private Preview, Azure unavailable), scaling and upgrades incur brief failover cutovers, and read replicas are separate (Scale tier+).
  6. Leaving Neon after outages requires always-on multi-AZ compute HA. Standard Neon uses stateless compute without an idle warm standby (1 to 10 minutes recovery on AZ failure per Neon docs) and couples wake and recovery paths to a shared regional control plane. Move latency-sensitive production workloads to dedicated multi-AZ warm standbys in isolated VPCs.

Why an uptime SLA badge does not tell you which managed Postgres is most reliable

In a 30-day month (43,200 minutes), 99.9% allows 43.2 minutes of monthly downtime (~8.77 hours/year), 99.95% allows 21.6 minutes (~4.38 hours/year), and 99.99% allows 4.32 minutes (~52.6 minutes/year). For a full breakdown of contractual targets versus internal reliability budgets, see the difference between SLAs, SLOs, and real reliability metrics.

The trap is what managed Postgres SLAs exclude from downtime calculations:

  • Amazon Aurora PostgreSQL (99.99% Multi-AZ SLA, 99.9% Single-AZ) explicitly excludes Micro instances, overloading an instance until it becomes inoperable, underlying database engine software that causes repeated crashes, and long recovery caused by insufficient I/O capacity.
  • Amazon RDS for PostgreSQL carries a 99.95% SLA for both Multi-AZ DB Instances and Multi-AZ DB Clusters (frequently misquoted online as 99.99%).
  • Google Cloud SQL carries 99.99% on Enterprise Plus (including planned maintenance) and 99.95% on Enterprise (excluding scheduled maintenance), never 99.999%, and excludes single-zone and shared-core instances as well as storage-exhaustion stoppages.
  • Aiven for PostgreSQL publishes a 99.99% SLO on Startup, Business, and Premium plans, but excludes periodic maintenance (up to 1 hour per month), security updates, customer overload, and virtual machine failures from underlying cloud subcontractors.
  • Neon limits its 99.95% SLA to Compute Endpoints on Business and Scale plans, excluding Free and Launch plans, partial minutes under 1 minute, and all control-plane or API outages.

Five systems properties predict actual production uptime far better than credit schedules:

  1. Recovery Point Objective (RPO): Whether committed transactions survive an abrupt primary loss. Only synchronous commit to at least one cross-AZ standby or storage quorum gives RPO = 0.
  2. Recovery Time Objective (RTO): Wall-clock time from primary failure to the application completing writes again. True RTO equals failure detection + promotion + pending WAL replay + DNS or connection-pool convergence (closely tied to operational mean time to recovery (MTTR) and incident metrics).
  3. Blast-radius isolation: Whether your database runs in an isolated per-cluster VPC with dedicated hosts or shares a multi-tenant control plane, proxy tier, or compute scheduler with thousands of other tenants.
  4. Logical replication slot continuity: Whether CDC pipelines (Debezium, ClickPipes, downstream logical subscribers) survive an HA failover without forcing a multi-terabyte full table resync.
  5. Verified backup and PITR integrity: HA replicates DROP TABLE and bad migrations instantaneously to every standby. Only continuous WAL archiving, tested restores, and isolated PITR protect against logical corruption.

Verify synchronous_commit semantics before assuming RPO = 0

In PostgreSQL 16 through 19 (Table 19.1 in the official WAL documentation), setting synchronous_standby_names alone is not enough. Durability on primary crash depends on synchronous_commit. Several managed providers default to asynchronous replication even on multi-node HA plans (for example, Aiven defaults pg.synchronous_commit to off, and Crunchy Bridge uses asynchronous streaming replication with a 30 MB promotion threshold).

synchronous_commit modeLocal durable WAL flushSurvives standby Postgres crashSurvives standby OS/power crashVisible on standby immediatelyRPO and failure semantics (when synchronous_standby_names is set)
remote_applyYesYesYesYesRPO = 0. Primary waits for standby WAL flush and replay. Highest commit latency; blocks if standby replay lags.
on (PG default)YesYesYesNoRPO = 0. Primary waits for standby receipt and durable fsync to disk. Zero committed data loss on single-node or AZ failure.
remote_writeYesYesNoNoWaits for standby OS write only (no fsync). Committed writes can be lost if both primary and standby hosts lose power together.
localYesNoNoNoRPO > 0 on primary failure. Primary flushes locally and ignores synchronous standbys.
offNoNoNoNoRPO > 0. Asynchronous local commit; up to 3 * wal_writer_delay (600 ms at default 200 ms) of recent commits can be lost on crash, with zero database corruption.

When a provider uses quorum syntax (synchronous_standby_names = 'ANY 1 (standby1, standby2)'), each commit waits for whichever standby acknowledges WAL flush first. Compare that to priority syntax (FIRST 1 (standby1, standby2)), which always waits on standby1 until it disconnects, or a 2-node single-sync setup where one stalled standby blocks all primary writes until failover or manual degradation.

Production managed Postgres HA architectures compared

Evaluating production reliability requires comparing actual replication topologies, standby isolation, failover mechanics, logical slot behavior, connection pooling, and storage-exhaustion behavior side by side. The matrix below covers eight production managed Postgres platforms verified directly against official vendor documentation on 2026-11-30.

Provider / HA modeHA topology & storageReplication & RPODocumented failover RTO / maintenanceHA standby readable?Published SLALogical slot failoverConnection poolingStorage growth & disk-full behavior
Amazon Aurora PostgreSQLShared distributed storage: 6 copies of 10 GiB segments (labeled 10 GB in AWS FAQs) across 3 AZs + writer + up to 15 Aurora ReplicasSync across 3 AZs (RPO = 0 in-Region); Global DB cross-Region async (seconds RPO; 0 planned switchover)< 60 s, often < 30 s with replicas (< 10 min single-node); RDS Proxy cuts failover up to 66%; Global DB planned < 30 s (PG 16.8+/15.12+)Yes (replicas share storage; CCM recommends idle Tier-0 reader)99.99% Multi-AZ (2+ AZs); 99.9% Single-AZPersists across in-Region failover on shared volume; major upgrade keeps slots on PG 17+ after drainingAmazon RDS Proxy (separate paid service)Auto-grows in 10 GiB increments up to 256 TiB (Limitless DB scales higher)
Amazon RDS Multi-AZ DB Instance1 primary + 1 passive standby in second AZ; EBS block-level replicationSync block-level across AZs (RPO = 0)60 to 120 s typical (longer for large transactions)No (passive; serves automated backups only)99.95% Multi-AZPG 17+ supports sync_replication_slots = 1 + failover = true for physical standbysAmazon RDS Proxy (separate paid service)Autoscales at <= 10% free for >= 5 min, 6-hour cooldown (max 64 TiB). Exhaustion triggers unavailable storage-full state
Amazon RDS Multi-AZ DB Cluster1 writer + 2 readable standbys across 3 AZs on local NVMe instance classes + persistent volumesPG native semisync quorum (ack from >= 1 reader, RPO = 0)< 35 s + pending ReplicaLag apply (~1 s minor upgrade with RDS Proxy)Yes (AWS warns heavy reads inflate ReplicaLag and failover RTO)99.95% Multi-AZSyncs writer logical slots to readers on PG 14.8-R2+ / 15.3-R2+Amazon RDS Proxy (optional, separate)Uses provisioned EBS for persistent data (storage autoscaling applies to RDS DB Instances, not all Multi-AZ DB Cluster configs); local NVMe capacity scales only with instance class
Google Cloud SQL (Enterprise vs. Enterprise Plus)Primary VM + passive standby VM in 2nd zone; sync Regional Persistent Disk / Hyperdisk BalancedSync disk replication across 2 zones (RPO = 0 HA)Unplanned failover ~60 s (shared static IP). Planned maint: < 1 s Enterprise Plus (HA primary, no replicas) vs. < 30 s avg EnterpriseNo (read replicas and read pools are separate)99.99% Enterprise Plus (incl. maint); 99.95% Enterprise (excl. maint)Advanced DR added failover slots (July 2026); in-Region HA shares regional diskManaged Connection Pooling (Enterprise Plus, GA Sept 2025)Auto-increase checks every 30 s up to 64 TB. If exhausted without auto-increase, instance stops (offline); maint skipped >97%
Azure Flexible Server (Zone-Redundant vs. Same-Zone)Zone-redundant: primary + passive standby in 2nd AZ + WAL replica in 3rd AZ for quorum. Same-zone: 1 AZ onlySync streaming replication to standby / WAL quorum (RPO = 0)60 to 120 s (can exceed 120 s if load outpaces 40 to 200 MB/s standby WAL replay)No (standby HA server cannot serve reads)99.99% Zone-Redundant; 99.95% Same-Zone; 99.9% No HAPG <= 16: pg_failover_slots; PG 17+: native sync_replication_slots = on + sync status metricBuilt-in PgBouncer 1.26.1 (port 6432, same VM, up to 10,000 conns, non-Burstable)Doubles Premium SSD online up to 32,768 GiB, except crossing 4,096 GiB requires offline resize (2 to 10 min) and autogrow ignores WAL. Read-only at 95% or < 5 GiB free
Crunchy Bridge (Snowflake-owned)1 primary + 1 hidden hot standby in second AZ on cloud block storage (gp3 on AWS); pgBackRest WAL archivingAsync streaming replication by default (promotes if <= 30 MB behind, else rebuilds)Managed failovers "no longer than a few minutes" (unplanned seconds unverified in docs)No (hidden hot standby; read replicas separate)99.95% Standard/Memory with HA (none on Hobby or non-HA)Read-replica publisher failover unsupported; HA slot preservation undocumentedBuilt-in PgBouncer (crunchy_pooler, port 5431, max_prepared_statements = 250)In-place disk autoresize at 85% (< 500 GB) / 90% (> 500 GB). Read-only at < 1 GB free or 95% of 10 GB disk
Aiven for PostgreSQLBusiness: 1 standby; Premium: 2 standbys across AZs (PGLookout)Async by default (pg.synchronous_commit = off); configurable up to on / remote_apply60 s initial timeout before promoting furthest-along standby; planned switchover keeps old primary forwarding >= 60 sYes (replica- endpoint serves read-only queries)99.99% SLO (Startup, Business, Premium; excludes maint <= 1 hr and cloud VM failures)Automatic slot recreation on failover and switchover (not major upgrades or power-off)Built-in PgBouncer (transaction mode default, max_prepared_statements up to 3,000)Opt-in Disk Autoscaler at 85% (read-only if disk fills first; added disk slower until next maintenance)
Neon (Databricks)Stateless compute VM + multi-AZ Paxos Safekeepers + Pageservers + S3/Azure BlobPaxos quorum WAL across Safekeepers (RPO = 0 committed WAL)No warm compute standby on standard plans. PG/VM crash: seconds; node failure: 1 to 2 min; unresponsive: 5 min; AZ failure: 1 to 10 minN/A for HA (stateless compute; read replicas separate)99.95% Compute Endpoint (Business/Scale only; excludes Launch/Free & control plane)Logical replication supported (must disable auto-suspend); unplanned compute-reschedule slot survival unverifiedBuilt-in PgBouncer via Neon Proxy (-pooler, up to 10,000 conns)Disaggregated object storage + Pageserver cache (plan storage quotas apply; no traditional local block-disk exhaustion)
ClickHouse Managed PostgresShared-nothing local NVMe VMs in dedicated isolated VPC per cluster. 0, 1 async, 1 sync + WAL listener (Preview), or 2 sync standbys across AZs2 standbys: sync quorum ANY 1 (s1, s2) (RPO = 0); 1 sync + listener (Preview): RPO = 0; 1 async: non-zero RPO. WAL-G every 60 s or 16 MBUnplanned failover "typically recovers within minutes"; vertical scale ~30 s; storage autoscale < 1 min; minor upgrades a few secondsNo (strictly non-readable; separate WAL-shipping read replicas on Scale+)See applicable ClickHouse Cloud service agreementBuilt-in failover slots for ClickPipes CDC; general third-party PG 17+ slot sync undocumentedBundled peered PgBouncer fleet (port 6432, transaction mode, max_prepared_statements = 200)Autoscale: 85% alert, 90% provision via WAL-G, 95% cutover (< 1 min). Tiered read-only safeguard (< 1 GB to < 2% free) prevents disk panic

Where each architecture wins on reliability

  • Amazon Aurora PostgreSQL: Aurora's 6-copy, 3-AZ distributed storage volume separates storage durability from compute node health. It survives the loss of two storage copies without impacting writes and three copies without impacting reads, auto-grows to 256 TiB without manual volume resizing, and fails over to a warm Aurora Replica in under 60 seconds (often under 30 seconds). When AWS-native integration, up to 15 read replicas, Serverless v2 elasticity, and distributed storage durability are your primary requirements, Aurora is the strongest default. Keep in mind that Aurora uses a custom distributed storage engine instead of stock PostgreSQL storage, and teams leaving Aurora usually do so for ingestion or billing reasons covered in our guides to Amazon Aurora alternatives and Aurora I/O costs and flat-pricing managed Postgres.
  • Amazon RDS for PostgreSQL: RDS trades Aurora's custom storage layer for standard PostgreSQL on EBS (Multi-AZ DB Instance) or local NVMe instance stores with two readable standbys (Multi-AZ DB Cluster). Choose RDS when AWS IAM, VPC tooling, broad regional availability, and familiar AWS operations decide the purchase. For teams evaluating moves off RDS due to EBS limits or TCO, see AWS RDS alternatives.
  • Google Cloud SQL Enterprise Plus: On GCP, Enterprise Plus has a 99.99% SLA that covers planned maintenance, with under-1-second planned maintenance downtime on HA primaries (without read replicas) backed by synchronous regional disk replication. Note that Cloud SQL is distinct from Google AlloyDB (which adds a disaggregated columnar engine and read pools). Because ClickHouse Managed Postgres is currently in Private Preview on GCP, Cloud SQL Enterprise Plus is the mature GA default for GCP-first production reliability. For teams comparing GCP options, see Cloud SQL for PostgreSQL alternatives.
  • Azure Database for PostgreSQL Flexible Server: Zone-redundant HA on Flexible Server fits Azure-native teams: it deploys a third-AZ WAL replica to preserve synchronous commit quorum (RPO = 0) if the standby temporarily disconnects, carries a 99.99% SLA, and includes built-in PgBouncer. Because ClickHouse Managed Postgres is not yet available on Azure, Flexible Server is the natural choice when Entra ID, Azure VNets, or Azure compliance boundaries decide. See Azure Database for PostgreSQL alternatives for broader comparisons.
  • Crunchy Bridge: Now part of Snowflake (acquired June 2025), Crunchy Bridge runs close-to-upstream PostgreSQL across AWS, GCP, and Azure with broad extension coverage, downloadable pgBackRest archives, and non-readable hidden hot standbys. Its main reliability trade-off is asynchronous default replication: it promotes standbys up to 30 MB behind, which leaves non-zero RPO on abrupt primary loss. See Crunchy Bridge alternatives if you are evaluating alternatives.
  • Aiven for PostgreSQL: Aiven fits organizations consolidating PostgreSQL alongside Kafka, OpenSearch, or Redis under one multi-cloud control plane. Before going to production on Aiven, audit two settings immediately: pg.synchronous_commit defaults to off (non-zero RPO until raised), and HA standbys accept read queries via the replica- endpoint unless your team explicitly avoids routing heavy reads there.
  • Neon: Neon is built for instant copy-on-write branching, preview environments, scale-to-zero economics, and developer workflows, with Paxos Safekeepers protecting committed WAL durability (RPO = 0). Its reliability trade-offs center on stateless compute (no warm compute standby on standard plans, 1 to 10 minute AZ recovery) and shared control-plane blast radius, detailed in the dedicated Neon section below.
  • ClickHouse Managed Postgres: Built on AWS (GA) and GCP (Private Preview) for sustained, I/O-heavy transactional workloads where you want zero-RPO synchronous quorum HA (ANY 1 across two non-readable local-NVMe standbys), strict vm.overcommit_memory = 2 OOM survival, isolated per-cluster VPCs, and peered PgBouncer fleets without network-storage tail latency. If you are weighing managed services against running Patroni or CloudNativePG yourself, see self-hosted vs. managed PostgreSQL.

Five real production failure modes compared across providers

SLA tables tell you what happens on paper. Production reliability depends on what happens inside PostgreSQL, the Linux kernel, and the storage stack during five common incidents.

Failure modeAmazon Aurora PostgreSQLRDS Multi-AZ Instance / ClusterGoogle Cloud SQL Enterprise PlusAzure Flexible Server (Zone-Redundant)Crunchy Bridge & AivenNeonClickHouse Managed Postgres
1. AZ or primary node crashStorage survives 2 lost copies (RPO = 0); reader promoted in < 30-60 s; CCM keeps idle Tier-0 cache warmInstance: EBS sync (RPO = 0), 60 to 120 s. Cluster: 2-reader quorum (RPO = 0), < 35 s + ReplicaLag applySync regional disk (RPO = 0); static IP moves to passive standby in ~60 sSync to standby + 3rd-AZ WAL quorum (RPO = 0); 60 to 120 s (longer if WAL replay lags 40 to 200 MB/s)Crunchy: async, promotes if <= 30 MB behind (RPO > 0). Aiven: synchronous_commit=off default (RPO > 0 unless tuned), 60 s timeoutSafekeepers keep committed WAL (RPO = 0); stateless compute reschedules in 1 to 10 min on AZ loss2 sync standbys ANY 1 quorum (RPO = 0); isolated per-cluster VPC; 1-sync + WAL listener (Preview); recovers in minutes
2. Runaway query / OOM spikeResource exhaustion can slow, restart, or fail over writer (AuroraMemoryNumDeclinedSqlTotal is MySQL-only)RDS db.r8g.large had 0% cluster survival at 23 runaway conns in ClickHouse Sept 2026 test (OOM killer SIGKILL crashed postmaster)Userspace memory supervisor terminates sessions (FATAL: terminating connection...); resource exhaustion can restart instanceDocs do not specify vm.overcommit_memory; OOM triggers restart/recoveryKernel vm.overcommit_memory setting undocumented in public docsCompute VM crash restarts automatically in seconds; temp tables and buffer cache lostvm.overcommit_memory = 2 returns clean SQLSTATE 53200; 100% cluster survival at 23 runaway conns (trade-off: ~57% RAM cap)
3. Connection stormSeparate RDS Proxy required to multiplex spikes and preserve conns across failoverSeparate RDS Proxy required; direct bursts exhaust max_connections and backend RAMBuilt-in Managed Connection Pooling (Enterprise Plus only)Built-in PgBouncer 1.26.1 (port 6432, same VM, up to 10,000 conns; restarts on failover)Built-in PgBouncer on both (Crunchy port 5431; Aiven transaction pooler)Built-in PgBouncer via shared Neon Proxy (-pooler, up to 10,000 conns)Bundled peered so_reuseport PgBouncer fleet (port 6432); 16-process fleet reached 336,469 select-only TPS (~4x single process)
4. Heavy reads or VACUUM hitting HA standbysShared storage avoids WAL replay lag, though AWS CCM warns not to run workloads on the Tier-0 failover readerInstance: non-readable (safe). Cluster: readable standbys; heavy reads inflate ReplicaLag and trigger flow_control write throttling (120 s default)Non-readable HA standby (safe); separate read replicas / read poolsNon-readable HA standby (safe); separate read replicasCrunchy: non-readable (safe). Aiven: readable standbys expose HA nodes to WAL replay contention and hot_standby_feedback bloatSeparate read replicas; compute scaling competes with shared storage cache warm-upStrictly non-readable HA standbys; separate Scale+ read replicas pull WAL from object storage (zero primary streaming load)
5. Disk full / WAL exhaustionAuto-grows in 10 GiB steps up to 256 TiB; lowest risk of sudden local disk exhaustionAutoscale needs 5 min low + 6-hour cooldown; bulk loads or stalled slots can leave DB storage-full (unavailable) for hoursAuto-increase checks every 30 s up to 64 TB; if exhausted, instance automatically stops (offline)Autogrow stops at 4,096 GiB offline wall and ignores WAL usage; read-only at 95% or < 5 GiB freeCrunchy: in-place resize 85/90%, read-only at < 1 GB. Aiven: opt-in 85% autoscale (slower disk), read-only if fullObject storage avoids traditional local block-disk ENOSPC; plan storage quotas applyWAL backpressure + autoscale (85% alert / 90% provision / 95% cutover < 1 min) + tiered read-only safeguard (< 1 GB to < 2% free)

How each failure mode plays out

  • AZ or primary crash: Check two things in your provider's configuration: whether replication is actually synchronous (RPO = 0), and whether losing one standby stalls writes. A two-node synchronous cluster protects data, yet a single slow standby degrades primary commit latency. A three-node quorum (ANY 1 across two cross-AZ standbys, or Azure's standby plus third-AZ WAL replica) lets commits proceed at the speed of the faster standby while preserving zero data loss.
  • Runaway query or OOM spike: Most engineering teams test AZ failover once a year and never test what happens when an ORM bug, recursive CTE, or AI-generated query allocates 15 GiB of unspillable executor memory. On Linux hosts running default heuristic overcommit (vm.overcommit_memory = 0), one OOM-killed backend forces the entire cluster into WAL crash recovery.
  • Connection storms: Serverless functions, Kubernetes autoscalers, and webhook bursts open thousands of short-lived connections. Without transaction pooling, PostgreSQL forks a process per connection and burns gigabytes of RAM and LWLock:ProcArray cycles before CPU ever reaches 100%. Even with PgBouncer, a single-threaded pooler saturates one CPU core under high query rates unless peered across cores.
  • Analytical or VACUUM load hitting standbys: Mixing BI queries, exports, or AI-agent reads onto HA standbys trades short-term cost savings for unpredictable failover RTO and primary table bloat (explained in detail below).
  • Disk full and WAL exhaustion: PostgreSQL documentation (Section 27.6.2) is blunt: a full data disk blocks writes, while a full WAL disk triggers a database server PANIC and shutdown. Common triggers are stalled logical replication slots (when max_slot_wal_keep_size = -1, see logical replication slots, WAL retention, and analytics offload), runaway temp-file spills (temp_file_limit = -1), or storage saturation outrunning autoscaling cooldowns (for EBS throughput and IOPS ceilings on AWS, see Postgres IOPS limits on RDS and EBS). Read-only circuit breakers (default_transaction_read_only = on triggered with 1 GB to 2%+ free headroom) keep reads online and preserve WAL space for recovery, whereas RDS storage-full and Cloud SQL instance auto-stop take the database completely offline.

Why serving reads on HA standbys undermines failover reliability

Several managed services pitch readable HA standbys (such as Amazon RDS Multi-AZ DB Clusters and Aiven Business/Premium plans) as a way to get high availability and read scaling from the same nodes. Inside PostgreSQL, combining those two roles creates three direct failure mechanisms that degrade both failover RTO and primary health.

1. WAL replay contention inflates failover RTO

A physical streaming standby runs a single-threaded startup process that applies WAL records sequentially. When application or analytical queries execute on that same standby, those queries compete directly with WAL recovery for CPU cores, disk I/O bandwidth, and shared_buffers. Even read-only queries on a hot standby perform physical disk writes: they set visibility hint bits on heap pages, spill temporary sort and hash files, and update relation caches.

During write-heavy periods on the primary, read load on a failover standby opens a widening gap between flush_lsn (WAL safely received) and replay_lsn (WAL actually applied). If the primary fails while the standby has gigabytes of unapplied WAL queued, promotion cannot finish until replay catches up. AWS's own RDS Multi-AZ DB Cluster documentation acknowledges this directly: heavy read workloads on reader instances slow WAL apply, increase ReplicaLag, lengthen failover time, and eventually trigger the flow_control extension (default threshold: 120 seconds of standby apply lag), which throttles commits on the primary writer itself. Similarly, Microsoft notes that Azure Flexible Server failover can exceed 120 seconds when primary writes outpace standby WAL recovery (typically 40 MB/s, up to 200 MB/s on larger instances).

2. Recovery conflicts versus hot_standby_feedback primary bloat

PostgreSQL's MVCC engine creates a second trap whenever a standby serves reads longer than a few seconds. When VACUUM on the primary removes dead tuple versions that a long-running SELECT on the standby still needs for its snapshot (or when DDL takes an AccessExclusiveLock), WAL replay hits a recovery conflict. Operators face two bad knobs:

  • Keep hot_standby_feedback = off and tune max_standby_streaming_delay (default 30s): Every time a conflict occurs, the standby pauses WAL replay for up to max_standby_streaming_delay before canceling the read query (ERROR: canceling statement due to conflict with recovery). Raising that parameter (or setting -1) to stop dashboard errors pauses WAL apply indefinitely on your failover target and stalls failover readiness.
  • Set hot_standby_feedback = on: The standby sends its oldest active transaction xmin back to the primary every wal_receiver_status_interval (default 10s). The primary's VACUUM and AUTOVACUUM are then forbidden from reclaiming any dead tuples newer than that standby query's xmin. A single 20-minute reporting query on a readable standby bloats heavily updated OLTP tables and indexes on the primary, which breaks Heap-Only Tuple (HOT) updates and increases crash-recovery volume.

3. Buffer-cache pollution causes post-failover latency cliffs

A standby serving analytical scans fills its shared_buffers and Linux OS page cache with cold historical partitions instead of the primary's hot OLTP working set. If failover occurs right after a large scan, the newly promoted primary starts with a cold OLTP cache and slams storage with synchronous random reads while application threads pile up. Even Amazon Aurora, whose shared storage layer eliminates WAL replay lag, explicitly advises in its Cluster Cache Management (CCM) documentation that "no workload should run on the designated tier-0 reader" so the failover target keeps a warm buffer cache.

Keeping HA standbys strictly non-readable (as done by RDS Multi-AZ DB Instances, Google Cloud SQL, Azure Flexible Server, Crunchy Bridge, and ClickHouse Managed Postgres) eliminates all three failure paths. Read scaling belongs on separate read replicas (and for heavy analytics, on a dedicated columnar store). On ClickHouse Managed Postgres, HA standbys never accept user queries; separate dedicated object-storage-backed read replicas (Scale tier and above) pull archived WAL from object storage in an isolated network environment. That puts zero streaming load or xmin bloat on the primary, at the trade-off of seconds-level lag (up to ~60 seconds on a quiet primary); ~10 to 20 ms streaming replicas are available via support request with an explicit warning that they re-introduce primary load and VACUUM bloat coupling.

OOM survival: why strict memory overcommit (vm.overcommit_memory = 2) keeps Postgres alive

Hardware failures are rare; bad queries are routine. A missing join predicate, a surge of parallel hash joins, or a recursive CTE generated by an internal tool or AI agent can spike memory consumption in seconds. How the host Linux kernel handles memory exhaustion decides whether one query returns an error or the entire Postgres cluster crashes.

Why a single OOM-killed backend crashes the entire cluster

PostgreSQL allocates work_mem per executor operation node (not per query or per connection), multiplies hash nodes by hash_mem_multiplier (default 2.0), and multiplies again across 1 + max_parallel_workers_per_gather. Worse, certain PostgreSQL executor structures (such as BuildTupleHashTable used for WITH RECURSIVE ... UNION deduplication) do not spill to disk regardless of work_mem.

On Linux hosts running the default heuristic overcommit policy (vm.overcommit_memory = 0), the kernel lets processes commit more virtual memory than physical RAM plus swap. When those pages are actually touched and physical RAM runs dry, the Linux OOM killer sends SIGKILL to a memory-heavy Postgres backend. Because every Postgres backend attaches to shared memory (shared_buffers, WAL buffers, lock tables), a SIGKILL leaves shared memory in an indeterminate state. Per PostgreSQL 19 documentation Section 18.4.4, the postmaster responds by terminating every remaining client connection and entering full WAL crash recovery from the last checkpoint. One bad query takes down every healthy session on the instance.

PostgreSQL's official documentation explicitly recommends configuring Linux strict memory overcommit (vm.overcommit_memory = 2) with an explicit commit ceiling (vm.overcommit_ratio or vm.overcommit_kbytes). Under strict overcommit, the kernel refuses allocations via ENOMEM before physical RAM runs out. PostgreSQL catches ENOMEM, rolls back only the offending query with SQLSTATE 53200 (out_of_memory), keeps the client connection open, and leaves all bystander sessions and postmaster completely untouched.

Controlled single-host validation (vm.overcommit_memory = 0 vs. 2)

In ClickHouse's published strict memory overcommit stress test (vm.overcommit_memory = 2), engineers tested both policies on identical hardware: a single AWS EC2 m7i.2xlarge (8 vCPU, 30.8 GiB RAM, PostgreSQL 16, 7.7 GiB reserved as 2 MB huge pages for shared_buffers = 6864MB, 20 idle bystander sessions plus a probe connecting every 0.3 s, and ramping sessions allocating ~2 GB arrays). Only vm.overcommit_memory changed.

MetricDefault policy (vm.overcommit_memory = 0)Strict overcommit (vm.overcommit_memory = 2)
Enforced commit limit11.6 GiB (advisory only, ignored)20.5 GiB (enforced via vm.overcommit_kbytes)
Peak committed memory23.6 GiB19.8 GiB
Memory still available at failure1.3 GB3.8 GB
Failure behaviorKernel OOM killer SIGKILL (backend 2.4 GB anon-rss); also killed systemd SSH sessionERROR: out of memory in SPI TupTable on 10th session
Bystander sessions dropped20 of 20 dropped0 of 20 dropped (1 query errored cleanly)
Cluster downtime (unresponsive to new connections)30.2 seconds (1.9 GB WAL redo + checkpoint of 239,686 buffers)0 seconds

Steady-state pgbench throughput on the same host showed no measurable penalty from strict overcommit: read-write throughput measured 15,878 TPS under strict overcommit versus 15,790 TPS under default overcommit (0.6% delta), and select-only throughput fell well within 4% to 5% run-to-run noise (211,882 vs. 216,606 TPS).

In production on ClickHouse Managed Postgres (engineered with Ubicloud), every VM sets vm.overcommit_memory = 2 and computes vm.overcommit_kbytes dynamically using (total_mem_kb * 0.75) * 0.8 + 2 * 1048576 (reserving 25% as 2 MiB huge pages for shared_buffers outside commit accounting, committing 80% of the remaining 75% [60% of total RAM] for backends, leaving the remaining 15% of total RAM for kernel structures and Linux page cache, and adding 2 GiB for virtual address reservations of Go sidecars like wal-g and metrics exporters; after base OS and daemon allocations, effective headroom for query backends is ~57% of host RAM).

Multi-provider runaway-query stress test (and the memory ceiling trade-off)

ClickHouse followed that single-host test with a September 2026 multi-provider benchmark (Can your Postgres survive a bad query?) on PostgreSQL 18.6 across 16 GiB RAM instances: ClickHouse Managed Postgres (r8gd.large, 118 GB local SSD, 2 sync standbys), Amazon RDS (db.r8g.large, 118 GiB gp3), and Google Cloud SQL (db-c4a-highmem-2, 118 GB Hyperdisk Balanced). Each run launched 7 to 23 concurrent connections executing a cyclic-graph WITH RECURSIVE ... UNION query consuming ~1 GiB of unspillable BuildTupleHashTable memory per connection (10 runs per concurrency level, 120 s statement_timeout).

  • ClickHouse Managed Postgres: 100% cluster survival across every concurrency level up to 23 concurrent connections. At 23 connections, it completed 32% of queries and rejected the rest cleanly with SQLSTATE 53200 (out_of_memory). Connections and pool slots remained open and bystander traffic stayed online.
  • Amazon RDS: Crashes began at 19 concurrent connections; at 23 concurrent connections, RDS recorded 0% cluster survival and 7% query completion, with the Linux OOM killer crashing the postmaster into full crash recovery on every single run.
  • Google Cloud SQL: Ran a userspace memory-pressure supervisor that killed sessions with FATAL: terminating connection due to administrator command. That kept the postmaster alive in many runs, though it dropped client sessions and showed instability at moderate load with occasional multi-minute recoveries.

Scope and trade-off caveats (important): This was a vendor-run synthetic stress test on one 16 GiB instance class using a pathological non-spilling query, and AWS/GCP do not publish their kernel vm.overcommit_memory settings in public docs. Strict overcommit also carries a deliberate capacity trade-off: ClickHouse Managed Postgres caps backend memory allocation at ~57% of host RAM (~9 GiB on a 16 GiB instance) to protect shared_buffers and kernel page cache. As a result, ClickHouse Managed Postgres starts rejecting runaway queries earlier (at 9 concurrent connections), whereas Amazon RDS completes more queries at moderate load before collapsing into full cluster crash recovery at 19 to 23 connections.

Logical replication slot failover and CDC continuity (PG 16 to 19)

If your application streams operational data out of Postgres via Debezium, PeerDB, ClickPipes, or native logical subscriptions, HA failover creates a hidden reliability trap: on PostgreSQL 16 and earlier, logical replication slots exist only on the primary. When an AZ outage promotes a physical standby, those slots vanish. Every CDC consumer fails, and teams face a multi-hour or multi-terabyte initial snapshot resync right after recovering from an outage.

How PostgreSQL 17, 18, and 19 solve slot failover

PostgreSQL 17 introduced native failover slot synchronization (not PG 16, which only added logical decoding on standbys). Three settings must work together:

  1. Mark the slot failover-capable: Create subscriptions with WITH (failover = true) or pass failover => true to pg_create_logical_replication_slot().
  2. Enable standby slot synchronization: Configure sync_replication_slots = on, hot_standby_feedback = on, primary_slot_name, and a database name in primary_conninfo on the physical standby so the slotsync worker mirrors failover slots periodically.
  3. Prevent consumers from outrunning the failover target: Set synchronized_standby_slots on the primary to the physical HA standby slot names. Logical WAL senders will not transmit commits to CDC subscribers until those physical standbys have flushed the WAL, preventing a subscriber from advancing past the LSN of the standby that gets promoted.

PostgreSQL 18 (released September 2025) added idle_replication_slot_timeout so abandoned slots automatically invalidate at checkpoint instead of filling the primary disk with retained WAL (synced standby slots are exempt). PostgreSQL 19 (released November 2026) added slotsync_skip_count, slotsync_last_skip, and slotsync_skip_reason so operators can detect stalled slot sync before a failover occurs.

How managed providers handle logical slot failover

  • Amazon Aurora PostgreSQL: Slots live on the shared 6-way cluster volume, so they persist automatically across in-Region writer failovers. For major version upgrades, slots must be dropped on PG < 17, whereas PG 17+ preserves them once subscriptions are disabled and pending WAL is drained.
  • Amazon RDS for PostgreSQL: Multi-AZ DB Clusters sync logical slots to reader instances on PG 14.8-R2+ / 15.3-R2+. Standard RDS on PG 17+ exposes sync_replication_slots = 1, synchronized_standby_slots, and rds.logical_slot_sync_dbname for physical standbys.
  • Azure Database for PostgreSQL Flexible Server: Requires the pg_failover_slots extension on PG <= 16, and supports native sync_replication_slots = on on PG 17+ alongside the logical_replication_slot_sync_status Azure Monitor metric.
  • Google Cloud SQL: Added logical replication failover slot support for Advanced Disaster Recovery switchovers and replica failovers in July 2026.
  • Aiven for PostgreSQL: Automatically recreates logical slots during HA failover and controlled switchovers (for services created or updated since January 2023), though slots are not preserved across power-off cycles or major upgrades.
  • ClickHouse Managed Postgres: Includes built-in failover replication slot preservation for CDC so native ClickPipes pipelines to ClickHouse survive HA failovers and scaling cutovers without full resyncs. (Support for general third-party PG 17+ sync_replication_slots outside ClickPipes is not currently documented in public Managed Postgres docs.)

Five runnable SQL diagnostics to audit your Postgres reliability today (PG 16-19)

Before trusting any managed provider's reliability checklist, run these five read-only, non-locking queries on your current production cluster. Every column and system function below is verified against PostgreSQL 16 through 19 official catalogs.

1. Synchronous quorum state and real WAL lag (PG 16-19)

Run on the primary to verify whether standbys are truly synchronous (RPO = 0) and whether replay_lag_bytes is inflating your failover RTO.

-- PostgreSQL 16-19 | Run on PRIMARY
-- Verifies sync/quorum state (RPO) and WAL flush/replay lag (RTO exposure).
WITH cfg AS (
  SELECT
    current_setting('synchronous_commit')        AS sync_commit,
    current_setting('synchronous_standby_names') AS sync_standbys,
    CASE WHEN pg_is_in_recovery()
         THEN pg_last_wal_receive_lsn()
         ELSE pg_current_wal_lsn() END           AS ref_lsn
)
SELECT
  r.application_name,
  r.client_addr,
  r.state,
  r.sync_state,         -- 'quorum' or 'sync' = RPO 0 path; 'async' = RPO > 0
  r.sync_priority,
  c.sync_commit,
  c.sync_standbys,
  pg_wal_lsn_diff(c.ref_lsn, r.sent_lsn)   AS send_lag_bytes,
  pg_wal_lsn_diff(c.ref_lsn, r.flush_lsn)  AS flush_lag_bytes,
  pg_wal_lsn_diff(c.ref_lsn, r.replay_lsn) AS replay_lag_bytes,
  r.write_lag,
  r.flush_lag,
  r.replay_lag,
  now() - r.reply_time                     AS since_last_reply
FROM cfg c
LEFT JOIN pg_stat_replication r ON true
ORDER BY NULLIF(r.sync_priority, 0) NULLS LAST, r.application_name;

Red flags: Zero connected standbys (application_name IS NULL), an empty sync_standbys, sync_commit NOT IN ('on', 'remote_apply') (including remote_write, which can lose commits on dual power failure), or every row reporting sync_state = 'async' means streaming replication has RPO > 0 on primary loss. A single sync standby with no quorum or potential backup means one standby stall blocks all commits. High replay_lag_bytes with low flush_lag_bytes signals WAL apply contention that extends failover RTO. (Note: storage-level HA such as Aurora, RDS Multi-AZ DB Instances, and Cloud SQL replicates below PostgreSQL and will not appear in pg_stat_replication.)

2. Standby read-conflict and WAL-replay stall audit (PG 16-19)

Run on any readable standby or read replica to expose recovery conflicts, unapplied WAL backlog, and whether hot_standby_feedback is holding back VACUUM on your primary.

-- PostgreSQL 16-19 | Run on STANDBY / READ REPLICA
-- Audits recovery conflicts, unapplied WAL backlog, and primary-bloat exposure.
SELECT
  c.datname,
  c.confl_snapshot,           -- Canceled because primary VACUUM removed needed tuples
  c.confl_lock,               -- Canceled due to DDL / AccessExclusiveLock replay
  c.confl_bufferpin,          -- Canceled due to pinned buffer pages
  c.confl_deadlock,
  c.confl_tablespace,
  c.confl_active_logicalslot, -- PG 16+: standby logical slots invalidated
  pg_wal_lsn_diff(
    pg_last_wal_receive_lsn(),
    pg_last_wal_replay_lsn()
  )                                               AS unapplied_wal_bytes,
  CASE WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn()
       THEN interval '0'
       ELSE now() - pg_last_xact_replay_timestamp()
  END                                             AS replay_age,
  current_setting('hot_standby_feedback')         AS hot_standby_feedback,
  current_setting('max_standby_streaming_delay')  AS max_streaming_delay,
  current_setting('max_standby_archive_delay')    AS max_archive_delay
FROM pg_stat_database_conflicts c
WHERE pg_is_in_recovery()
ORDER BY (c.confl_snapshot + c.confl_lock + c.confl_bufferpin) DESC;

Red flags: hot_standby_feedback = 'on' on a readable HA standby exposes your primary to dead-tuple bloat during long reads. Non-zero confl_snapshot paired with growing unapplied_wal_bytes and a high max_streaming_delay confirms read queries are delaying failover readiness. (On archive-only WAL-shipping replicas, pg_last_wal_receive_lsn() is NULL, so rely on replay_age instead of unapplied_wal_bytes.)

3. Logical slot failover safety and WAL-retention bomb audit (PG 17-19)

Run on the primary to catch CDC slots that will vanish on failover and inactive slots accumulating WAL toward disk exhaustion. (On PostgreSQL 16, omit failover, synced, invalidation_reason, inactive_since, and synchronized_standby_slots, and note that PG 16 has no native failover slot sync.)

-- PostgreSQL 17-19 | Run on PRIMARY
-- Audits logical slot failover readiness and disk-full ("WAL bomb") exposure.
SELECT
  slot_name,
  slot_type,
  plugin,
  database,
  active,
  failover,                  -- TRUE = eligible to sync to standbys (PG 17+)
  synced,                    -- TRUE on standby/promoted standby when synced (PG 17+)
  wal_status,                -- 'reserved', 'extended', 'unreserved', or 'lost'
  invalidation_reason,       -- NULL when healthy (PG 17+)
  inactive_since,            -- NULL when active; disconnect timestamp otherwise (PG 17+)
  round(
    pg_wal_lsn_diff(
      CASE WHEN pg_is_in_recovery()
           THEN pg_last_wal_receive_lsn()
           ELSE pg_current_wal_lsn() END,
      restart_lsn
    ) / 1048576.0, 1
  )                                               AS retained_wal_mb,
  round(safe_wal_size / 1048576.0, 1)             AS safe_wal_headroom_mb,
  CASE
    WHEN current_setting('max_slot_wal_keep_size') = '-1'
    THEN 'UNBOUNDED (-1)'
    ELSE current_setting('max_slot_wal_keep_size')
  END                                             AS max_slot_wal_keep_size,
  current_setting('synchronized_standby_slots')   AS synchronized_standby_slots
FROM pg_replication_slots
ORDER BY retained_wal_mb DESC NULLS LAST;

Red flags: Any logical slot with failover = false (or empty synchronized_standby_slots) will break downstream CDC on failover unless handled externally by the provider. Any inactive slot (active = false) with climbing retained_wal_mb and UNBOUNDED (-1) max_slot_wal_keep_size can fill the WAL disk and PANIC the server.

4. Connection-storm and executor memory blast-radius audit (PG 16-19)

Run on the primary as a superuser or a member of pg_monitor / pg_read_all_stats to see whether idle connections or parallel query memory multiplication put your host in OOM-killer range.

-- PostgreSQL 16-19 | Run on PRIMARY (or standby)
-- Estimates connection saturation and concurrent parallel-query memory burst.
WITH conn AS (
  SELECT
    count(*) FILTER (WHERE backend_type = 'client backend') AS client_conns,
    count(*) FILTER (WHERE state = 'active'
                       AND backend_type = 'client backend') AS active_conns,
    count(*) FILTER (WHERE state = 'idle'
                       AND backend_type = 'client backend') AS idle_conns,
    count(*) FILTER (WHERE state LIKE 'idle in transaction%'
                       AND backend_type = 'client backend') AS idle_in_xact_conns
  FROM pg_stat_activity
),
mem AS (
  SELECT
    current_setting('max_connections')::int                 AS max_connections,
    pg_size_bytes(current_setting('shared_buffers'))        AS shared_buffers_bytes,
    pg_size_bytes(current_setting('work_mem'))              AS work_mem_bytes,
    current_setting('hash_mem_multiplier')::numeric         AS hash_mem_mult,
    current_setting('max_parallel_workers_per_gather')::int AS parallel_workers
)
SELECT
  c.client_conns,
  m.max_connections,
  round(100.0 * c.client_conns / m.max_connections, 1)      AS conn_util_pct,
  c.active_conns,
  c.idle_conns,
  c.idle_in_xact_conns,
  pg_size_pretty(m.shared_buffers_bytes)                    AS shared_buffers,
  pg_size_pretty(m.work_mem_bytes)                          AS work_mem,
  m.hash_mem_mult,
  m.parallel_workers,
  -- Conservative multi-node estimate: 1 hash + 1 sort across (leader + workers)
  pg_size_pretty(
    ((m.work_mem_bytes * m.hash_mem_mult) + m.work_mem_bytes)::bigint
    * (1 + m.parallel_workers)
  )                                                         AS est_single_parallel_query_mem,
  pg_size_pretty(
    (((m.work_mem_bytes * m.hash_mem_mult) + m.work_mem_bytes)::bigint
    * (1 + m.parallel_workers)) * greatest(c.active_conns, 1)
  )                                                         AS est_active_burst_mem
FROM conn c
CROSS JOIN mem m;

Red flags: High idle_conns pushing conn_util_pct > 70% signals missing transaction pooling. Any sustained idle_in_xact_conns holds open snapshots that stall VACUUM. If est_active_burst_mem approaches (Host RAM - shared_buffers), a concurrent spike can trigger an OOM kill on default-overcommit hosts (and unspillable executor structures bypass work_mem altogether).

5. WAL archiving and PITR health audit (PG 16-19)

Run on the primary to verify that continuous WAL archiving for PITR is not failing silently while HA metrics stay green.

-- PostgreSQL 16-19 | Run on PRIMARY
-- Detects silent PITR rot and stalled WAL archiving before a logical disaster.
SELECT
  current_setting('archive_mode')        AS archive_mode,
  current_setting('archive_timeout')     AS archive_timeout,
  archived_count,
  last_archived_wal,
  last_archived_time,
  now() - last_archived_time             AS time_since_last_archive,
  failed_count,
  last_failed_wal,
  last_failed_time,
  CASE
    WHEN current_setting('archive_mode') = 'off' THEN 'CRITICAL: WAL archiving disabled (no PITR)'
    WHEN last_failed_time IS NOT NULL
         AND (last_archived_time IS NULL OR last_failed_time > last_archived_time)
      THEN 'CRITICAL: Archiver currently failing'
    WHEN last_archived_time IS NULL
      THEN 'WARNING: No WAL archived since stats_reset'
    WHEN now() - last_archived_time > interval '15 minutes'
      THEN 'WARNING: Archive lag exceeds 15 minutes (check traffic or archive_timeout)'
    ELSE 'OK'
  END                                    AS archive_health,
  stats_reset
FROM pg_stat_archiver;

Red flags: last_failed_time > last_archived_time means PITR is broken right now and unarchived WAL segments are piling up in pg_wal. An archive_timeout of 0 on a low-write database leaves committed transactions in an unfilled 16 MB WAL segment unarchived until the segment fills, which widens your disaster-recovery RPO window. (Note: on shared-storage engines such as Amazon Aurora, continuous backups run at the storage layer, so archive_mode = 'off' in pg_stat_archiver is expected.)

Quorum HA on local NVMe without collapsing throughput (ClickHouse Managed Postgres architecture and trade-offs)

A common assumption in cloud database discussions is that local NVMe storage is fast but fragile, so zero-RPO production workloads must accept network-attached block storage (EBS or Persistent Disk) and higher p99 latency. ClickHouse Managed Postgres resolves local-NVMe ephemerality at the replication, archiving, and isolation layers while keeping commit latency low.

How the reliability stack fits together

  • Two-sync-standby quorum HA (ANY 1): On ClickHouse Managed Postgres HA topologies, the two-standby option deploys two strictly non-readable synchronous standbys in separate AZs with quorum acknowledgment (ANY 1 (standby1, standby2), RPO = 0). Each commit waits for whichever standby flushes WAL first, so a slow standby or full AZ outage does not stall writes or leave you without a failover target. For cost-sensitive RPO = 0 clusters, ClickHouse Managed Postgres also supports a 1 Standby Synchronous + lightweight WAL listener (Preview) option that pairs one full standby with a no-extra-cost WAL listener as the second quorum path.
  • Continuous WAL-G archiving and direct-I/O backups: A persistent wal-g daemon archives WAL every 60 seconds or 16 MB (whichever occurs first) alongside daily full backups to erasure-coded object storage inside per-instance isolated buckets (WAL-G continuous archiving and PITR to a new instance). Backups use direct I/O backups without evicting the page cache so nightly base backups do not cause tail-latency spikes, and WAL backpressure safeguards prevent extreme write bursts from outpacing WAL archiving or filling local NVMe.
  • Dedicated VPC per cluster and peered PgBouncer fleets: Every cluster runs inside its own dedicated per-cluster VPC isolation and HA architecture with TLS 1.3 minimum, per-instance CA certificates, and AES-256 encryption at rest (network isolation, TLS 1.3, and encryption at rest). On port 6432, bundled PgBouncer transaction pooling runs as a peered PgBouncer fleet architecture using so_reuseport with cross-process query cancellation. In ClickHouse's c7i.4xlarge (16 vCPU) select-only transaction-pooled benchmark, a single PgBouncer process peaked at 86,570 TPS (64 clients) and dropped to 76,893 TPS at 256 clients, while a peered fleet of 16 processes reached 336,469 TPS (~4x) at 256 clients (at 8 clients, a single process was slightly faster: 8,910 vs. 6,450 TPS).

Synchronous HA throughput cost: PostgresBench HA

Synchronous cross-AZ replication normally imposes a steep throughput or tail-latency tax on network-attached storage. In ClickHouse's published PostgresBench HA results (20,720 TPS with 2 sync standbys) (July 2026, open-source PostgresBench suite), engineers measured pgbench TPC-B-like throughput (-c 256 -j 16 -T 600 -M prepared) on 16 vCPU / 64 GB RAM instances over a ~500 GB dataset in AWS us-east-2 using untuned defaults:

ProviderHA configuration testedAvg TPSShare of own single-node TPSAvg latencyp99 latency
ClickHouse Managed PostgresSingle node (no HA)26,328100%9.70 ms13.20 ms
ClickHouse Managed Postgres1 standby, async (RPO > 0)24,66794%10.37 ms24.17 ms
ClickHouse Managed Postgres2 standbys, sync quorum (ANY 1, RPO = 0)20,72079%12.34 ms33.49 ms
Crunchy BridgeHA (1 standby, async, RPO > 0)11,135100%23.00 ms41.89 ms
Amazon Aurora PostgreSQLHA (1 Aurora Replica, 6-way storage RPO = 0)9,520103%26.87 ms39.92 ms
NeonSingle node (Paxos Safekeepers RPO = 0)7,802100%32.80 ms56.30 ms
Amazon RDS Multi-AZ Cluster2 readable standbys, sync quorum (RPO = 0)4,659106%54.92 ms816.63 ms
Amazon RDS Multi-AZ Instance1 passive standby, sync EBS (RPO = 0)4,461101%57.35 ms221.69 ms

Mandatory benchmark caveats: This is a vendor-run benchmark by ClickHouse on one synthetic OLTP workload with default untuned configurations, and it does not compare monthly pricing (a two-sync-standby cluster provisions three full VMs). As the benchmark authors explicitly note, these numbers measure the performance overhead of running HA, not failover speed, chaos testing, or multi-region resilience. They do not contest Amazon Aurora's distributed storage durability or failover speed, and in the broader PostgresBench suite at the smaller 4 vCPU / ~100 GB configuration, Crunchy Bridge led ClickHouse Managed Postgres (6,338 vs. 6,172 TPS). For a step-by-step tuning playbook on raising single-primary throughput (PgBouncer pooling, HOT updates, WAL sizing, analytical offload, and vertical NVMe ceilings before sharding), see how to increase Postgres TPS and scale without sharding.

Explicit ClickHouse Managed Postgres trade-offs to weigh before adopting

Before adopting ClickHouse Managed Postgres, account for six current limitations:

  1. Cloud availability: Generally Available on AWS only (since November 9, 2026; see ClickHouse Managed Postgres GA on AWS (GCP Private Preview)). Google Cloud (GCP) is in Private Preview (unbilled during preview, post-preview pricing not yet finalized, GA date unannounced), and Azure is planned (not available).
  2. Brief failover downtime on scaling and upgrades: Storage is coupled to VM shape. Manual vertical scaling restores a replacement node via WAL-G and cuts over with ~30 seconds of failover downtime; automatic storage scaling (triggered at 90%, forced cutover at 95%) incurs typically under 1 minute of downtime (storage autoscaling thresholds and vertical-scale failover). Minor upgrades run via scheduled upgrades via standby failover with a few seconds of disconnect (< 1 minute expected within a 2-hour UTC window), and major version upgrades via UI/API are planned (handled via support ticket today; see minor and major version upgrade process).
  3. Separate read replicas on Scale tier and above: Because HA standbys never serve reads, read offloading requires separate read replicas on Scale or Enterprise tiers.
  4. 60 TB local NVMe storage ceiling: Single-instance storage scales from 59 GB up to 60 TB NVMe (compared to 64 TiB on RDS, 64 TB on Cloud SQL, and 256 TiB on Aurora).
  5. Earlier OOM rejection ceiling (~57% RAM): Enforcing vm.overcommit_memory = 2 protects cluster survival at the cost of rejecting runaway backend allocations earlier than default-overcommit hosts.
  6. PITR-based branching today (not serverless): Current branching restores from PITR backups (taking several minutes to tens of minutes). Instant copy-on-write branching and scale-to-zero from the Xata acquisition are planned, not shipped; ClickHouse Managed Postgres is not a serverless scale-to-zero service today.

When your workload also needs high-concurrency analytics without putting BI scans on Postgres, ClickHouse Managed Postgres and ClickHouse within ClickHouse Cloud separate OLTP and OLAP via ClickPipes CDC (free compute for Managed Postgres sources; seconds-level eventual consistency, with ClickHouse analytical capacity billed separately) and pg_clickhouse for supported foreign-table queries. For example, Physical Intelligence migrated OLTP from a single Amazon RDS instance to ClickHouse Managed Postgres (with PgBouncer absorbing batch bursts) while moving 10 to 100 billion annotation rows to ClickHouse; as Chandra at Physical Intelligence noted in the Physical Intelligence case study, "once we migrated here, there are a class of issues that we were seeing before that were completely gone."

Outgrowing serverless Postgres outages? Evaluating reliability-first alternatives to Neon

Neon's disaggregated serverless design (stateless compute VMs over multi-AZ Paxos Safekeepers, Pageservers, and S3/Azure Blob) fits instant database branching, ephemeral preview environments, and scale-to-zero workloads. When teams ask "Neon keeps going down, is there a more reliable managed Postgres?" or "Neon keeps having outages, what's a more reliable Postgres?", the friction usually comes from two documented architectural properties.

What Neon's own docs and postmortems show

  1. No warm standby compute on standard plans: While Neon's Safekeepers replicate committed WAL across AZs (RPO = 0), standard Neon plans do not run an idle warm compute standby ready for instant promotion. Neon's own HA documentation lists compute recovery times of 1 to 2 minutes on a Kubernetes node failure, 5 minutes for an unresponsive endpoint, and 1 to 10 minutes on an Availability Zone failure as computes reschedule onto healthy nodes. Neon's 99.95% Compute Endpoint SLA applies only to Business and Scale plans (excluding Free, Launch, and control-plane APIs). In its own published reliability recap for January through April 2026, 99.93% to 99.96% of monthly active Neon databases met 99.95% uptime (99.75% to 99.85% met 99.99%).
  2. Shared regional control-plane blast radius: In a scale-to-zero fleet where computes constantly wake and suspend, the control plane sits on the operational data path. Neon's own postmortems document how shared control-plane incidents cascade:
    • May 16 and 19, 2025 (us-east-1): A query-plan regression on the control plane's backing Postgres computes table stalled idle-compute suspension. Active pods surged from ~6,000 to ~8,000 and exhausted AWS VPC CNI IPv4 addresses across two of three subnets, which blocked database creation and wakeups for 5.5 hours total (already-running computes stayed online).
    • Pageserver incident (us-east-1): Neon's incident review documented 30 to 60 minutes of unavailability for most impacted databases and ~2 hours for a smaller subset.
    • May 8, 2026 (us-east-1): During an AWS AZ issue, 1 of 8 Neon cells failed to fail over cleanly and affected roughly 13% of databases in the region.
    • 2026 reliability retrospective: Neon's engineering team reported two additional incidents in one week where external dependency failures triggered self-reinforcing control-plane backpressure loops that can block database creation, waking, and recovery.

Choosing the right replacement when moving off Neon for reliability

Do not migrate from Neon's serverless tier to another provider's single-node starter tier. Pick an always-on Multi-AZ topology matched to your cloud and workload:

  • AWS-native standard with distributed storage durability: Move to Amazon Aurora PostgreSQL (99.99% Multi-AZ SLA, 6 storage copies across 3 AZs, warm Aurora Replicas) or Amazon RDS Multi-AZ DB Instance (99.95% SLA, non-readable sync standby).
  • GCP-native production: Move to Google Cloud SQL Enterprise Plus (99.99% SLA, < 1 s planned maintenance, synchronous regional disk).
  • Azure-native production: Move to Azure Database for PostgreSQL Flexible Server with zone-redundant HA enabled (99.99% SLA, 3rd-AZ WAL quorum).
  • Multi-cloud vanilla Postgres or unified OSS fleet: Evaluate Crunchy Bridge (with HA enabled, accounting for its async 30 MB promotion window) or Aiven (with pg.synchronous_commit explicitly raised from off to on).
  • I/O-heavy always-on AWS workloads wanting isolated VPCs, ANY 1 sync quorum, and OOM survival: Evaluate ClickHouse Managed Postgres (keep in mind you trade away Neon's instant copy-on-write branching and scale-to-zero today in exchange for always-on local NVMe and dedicated VPC isolation). Public production teams migrating from Neon for reliability illustrate the pattern:
    • David AI moved from Neon to ClickHouse Managed Postgres for "better reliability and performance" (Jarrod Servilla, Platform Engineer, GA announcement).
    • Shipsidekick experienced peak-hour outages exceeding 10 minutes and drops above ~3,000 connections on Neon before moving ~500 GB over a weekend via ClickPipes. After the move, peak CPU fell from 100% to 5-10% and bundled PgBouncer absorbed 10,000 req/s webhook bursts (Sawyer Bateman, Founder and CEO, Shipsidekick's migration off Neon).
    • Infinitas Learning (324 million annual learner assignments) migrated 750 GB from Neon in under 16 hours and cut p99 query latency from seconds to double-digit milliseconds (Jerome van den Heuvel, Engineering Manager, Infinitas Learning case study).

For a broader feature-by-feature exit matrix and migration steps off Neon (including branching replacements and pricing), see our guide to Neon alternatives for production workloads. For a full seven-criterion vendor evaluation and five-phase POC checklist beyond HA mechanics, see how to choose a managed Postgres provider. If your AWS workload requires zero-RPO quorum HA, strict OOM survival, and local NVMe predictability, you can test ClickHouse Managed Postgres directly on a 30-day free trial.

Sources

All documentation, SLAs, postmortems, and benchmarks below were verified on 2026-11-30:

FAQ

What's the most reliable managed Postgres for production?

No single provider fits every workload. On AWS, Amazon Aurora PostgreSQL (99.99% SLA, 6 storage copies across 3 AZs) is the standard baseline for distributed storage durability. On GCP, Google Cloud SQL Enterprise Plus (99.99% SLA) gives under-1-second planned maintenance. On Azure, Flexible Server zone-redundant HA adds a third-AZ WAL quorum. For I/O-heavy AWS OLTP needing zero-RPO quorum HA, strict OOM survival, and isolated VPCs, evaluate ClickHouse Managed Postgres.

Which managed Postgres is most reliable?

Reliability depends on five verified mechanics: synchronous RPO = 0 replication, predictable failover RTO, OOM crash protection, non-readable HA standbys, and logical slot survival. Aurora PostgreSQL, Cloud SQL Enterprise Plus, and Azure Flexible Server zone-redundant HA lead among hyperscalers with 99.99% SLAs. ClickHouse Managed Postgres fits AWS workloads that need strict vm.overcommit_memory = 2 OOM survival, ANY 1 two-standby local-NVMe quorum HA, and dedicated per-cluster VPC isolation.

Neon keeps going down, is there a more reliable managed Postgres?

Yes. Standard Neon runs stateless compute without an idle warm standby (1 to 10 minutes AZ recovery) and couples wake and recovery paths to a shared regional control plane. For always-on stability, move to Multi-AZ warm standbys: Amazon Aurora or RDS Multi-AZ on AWS, Cloud SQL Enterprise Plus on GCP, Azure Flexible Server zone-redundant HA on Azure, or ClickHouse Managed Postgres on AWS for isolated VPCs and two synchronous standbys.

Neon keeps having outages, what's a more reliable Postgres?

Replace serverless stateless compute with dedicated Multi-AZ hot standbys and isolated networking. On AWS, pick Amazon Aurora PostgreSQL for distributed storage durability or ClickHouse Managed Postgres for two-sync-standby (ANY 1) local-NVMe clusters in isolated VPCs with bundled PgBouncer and strict OOM survival. On GCP or Azure, use Cloud SQL Enterprise Plus or Azure Flexible Server zone-redundant HA. Avoid moving to another provider's single-node tier without synchronous HA.

Does serving reads on HA standbys hurt Postgres failover reliability?

Yes. Readable HA standbys (such as RDS Multi-AZ DB Clusters and Aiven) force read queries to compete with single-threaded WAL replay for CPU, I/O, and buffer cache. Long reads either pause WAL replay via max_standby_streaming_delay (inflating failover RTO) or hold back primary VACUUM via hot_standby_feedback = on (causing primary bloat). Keeping HA standbys non-readable and isolating reads onto separate replicas protects both failover time and primary stability.

How does `vm.overcommit_memory = 2` prevent Postgres OOM outages?

Under default Linux heuristic overcommit (vm.overcommit_memory = 0), a runaway query triggers the Linux OOM killer to send SIGKILL to a backend, which makes Postgres drop every active connection and run full WAL crash recovery. Strict overcommit (vm.overcommit_memory = 2) returns ENOMEM before RAM runs out, so Postgres aborts only the offending query with SQLSTATE 53200 and keeps bystander connections online at a ~57% RAM ceiling.

Is local NVMe reliable enough for production Postgres?

Local NVMe drives are ephemeral on single-host failure, so a single-node NVMe instance is never production HA. Production durability on local NVMe comes from synchronous quorum replication (ANY 1 across two cross-AZ standbys for RPO = 0 during host or AZ loss) paired with continuous WAL archiving to erasure-coded object storage (every 60 seconds or 16 MB via WAL-G). That design preserves local-NVMe tail latency while surviving zone failures.


Share this resource

  • Y Combinator icon
  • X icon
  • Bluesky icon
  • Facebook icon
  • LinkedIn icon

Subscribe to our newsletter

Stay informed on feature releases, product roadmap, support, and cloud offerings!

More like this

Compare 8 managed PostgreSQL hosting providers for startups across pricing, high availability, backups, scaling, developer workflows, and analytics.

Continue reading ->

Self-hosted vs. managed PostgreSQL: when to switch

Manveer Chawla • Last updated: Sep 3, 2026

Compare self-hosted and managed PostgreSQL across cost, control, backups, HA, scaling, and migration to decide whether to switch or stay self-hosted.

Continue reading ->

8 Crunchy Bridge alternatives for managed PostgreSQL in 2026

Manveer Chawla • Last updated: Sep 25, 2026

Compare 8 Crunchy Bridge alternatives for managed PostgreSQL across storage, HA, analytics, cloud fit, compatibility, cost, and migration.

Continue reading ->