Zero-Downtime Patching Part 1: Prewarming
Neon and Databricks Lakebase avoid the post-restart performance hit of cold Postgres caches by prewarming a replacement compute before planned maintenance. Shortly before the scheduled restart, the control plane starts a hidden new compute, sends it the list of pages in the primary's cache, and loads them from shared storage. It then tails WAL from Safekeepers, applying only records that touch cached pages, and finally promotes it with pg_promote without restarting the server. In 10 GB pgbench tests, throughput recovers almost immediately with prewarming, compared with a roughly 70% TPS drop and slow recovery on a cold restart, with the largest gain on read-only workloads.
Related posts
- Cold starts just got hot
Neon mediumAdept
Neon cut serverless Postgres compute cold starts from 3-6 seconds to roughly 500 ms by skipping work and reframing the problem. Idempotent configuration application (1-1.5 s) now runs only when tracked config changes require it, which needed a new model where computes fetch their own config. Pre-started compute pools hand out an empty compute and configure it in a few hundred milliseconds, recycling idle computes and falling back to on-demand creation. Smaller gains came from networking setup changes, caching internal IPs to avoid DNS waits, added concurrency and hot-path optimization. Planned work includes regional control planes and autoscaling computes so one pool can serve all sizes.
- Improving Lakebase Postgres Compute Cache on Neon, Part 1
Neon hardMaster
On large fixed-size Lakebase Postgres computes, Neon now disables its NVMe-backed local file cache and sets shared buffers to 75% of DRAM (up from a 1 GB cap), backed by explicit 2 MB HugeTLB pages provisioned through host, hypervisor and guest VM. Huge pages cut per-backend page table overhead by 512× and reduce TLB misses, lowering tail read latency by up to ~40% and CPU by up to ~30% in benchmarks. Production endpoints saw up to 2× throughput, 5× fewer storage GetPage requests and 5× lower CPU, with near-100% cache hit rates. Autoscaling computes with dynamic shared buffers are planned for part 2.
- Everyone gets faster writes: We turned off FPW's in Neon
Neon hardMaster
Neon disabled Postgres full-page writes fleet-wide because its stateless compute streams WAL to a Paxos safekeeper quorum and has no local disk pages that can tear. To keep delta chains bounded without FPW images, the pageserver now generates page images itself once a page accumulates more deltas than a threshold, rather than relying on the checkpoint cycle. HammerDB TPROC-C throughput rose up to 4.5x on 32 vCPU, and WAL per transaction fell from 58KB to under 4KB (94%). In production, p99 read latency dropped 30-50%, and the change was rolled out without restarts via the XLOG_FPW_CHANGE WAL record.
- Separation of storage and compute without a performance tradeoff
Neon easyNovice
Neon's Local File Cache (LFC) sits between Postgres shared buffers and Neon's remote multi-tenant page storage. It uses the Linux page cache for RAM-like latency and can spill to local NVMe, so Neon keeps elastic, decoupled storage while matching local-disk Postgres performance. On a TPCC-like sysbench benchmark at 8CU, a 500GB LFC raised QPS from 12,512 to 17,030 and cut p99 latency from 593ms to 384ms, close to a local-disk setup needing 929GB. Sizing the LFC to the estimated working set (180GB) lost only about 10% of peak QPS.
- Lakebase Postgres is built on object storage, but 99.99999% of reads never touch it
Neon mediumAdept
Lakebase Postgres stores durable history in object storage but keeps it off the read path through tiered caching. Production fleet stats show the compute's local cache serving ~1.1B page accesses/sec (99.46%), pageserver NVMe ~6M/sec (0.54%), and object storage only ~39 requests/sec, about 1 in 28 million reads, mostly from long-dormant project wakeups or branches and restores at old LSNs. Pageservers answer GetPage@LSN by replaying delta layers on top of the nearest image layer. Creating image layers more eagerly keeps p90 under 1 delta and p99 around 6 per read.