How posix_spawn & close_range “fixed” cold starts
Neon's Pageserver regressed cold-start and first-query-after-idle latency to seconds after it began shutting down idle per-tenant walredo sidecar processes. Spawning them was slow because a pre_exec hook (used to mark inherited file descriptors close-on-exec) forced Rust's std::process::Command to fall back from posix_spawn to fork+exec. The real cost turned out to be the close_fds crate's fallback: CLOSE_RANGE_CLOEXEC isn't supported on Linux 5.10, so it issued one fcntl per open FD, roughly 2s across ~200k descriptors. Moving a plain close_range call into the walredo process itself cut basebackup latency from ~2s mean and ~10s p99 to the low hundreds of milliseconds.
Related posts
- parking_lot: ffffffffffffffff...
Fly.io hardMasterFly.io's Rust Anycast router, fly-proxy, kept deadlocking after Catalog state was moved to lazy loading. The cause was traced to parking_lot RwLock words being set to 0xFFFFFFFFFFFFFFFF. The hunt ran from a known if-let lock-lifetime footgun through closure-scoped lock refactors with timeouts and telemetry, parking_lot's deadlock detector, gdb core-dump inspection, read_recursive experiments and miri. Core dumps showed threads waiting on a lock nobody held, and logging the raw lock word revealed every bit set, including the unused UPGRADEABLE flag. The post also covers Corrosion, Fly.io's CRDT-structured SQLite replicated over SWIM gossip, and the watchdog that bounces stuck proxies to keep deadlocks survivable.
- Why we rewrote WAL-G for Postgres backups in Rust: Meet WAL-RUS
ClickHouse mediumAdept
WAL-RUS is an open-source Rust rewrite of WAL-G's Postgres backup and WAL archival tooling, built because Go's garbage-collected runtime made virtual memory hard to predict in resource-constrained managed Postgres environments where overcommit is disabled. It uses bounded worker pools, a persistent daemon with long-lived object storage connections, and a low-copy streaming read-compress-upload pipeline, while keeping WAL-G's WALG_ config variables and two-way archive compatibility. In a WAL-heavy benchmark with four workers archiving to S3, WAL-RUS peaked below 1 GB of virtual memory versus nearly 2.8 GB for WAL-G (over 70% less), with comparable throughput and CPU. pgBackRest also had tight memory but built a larger backlog under heavy WAL activity. WAL-RUS adds incremental backups based on Postgres 17 WAL summaries and is slated to become the default for ClickHouse Cloud's managed Postgres.
- 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.
- Zero-Downtime Patching Part 1: Prewarming
Neon mediumAdept
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.
- 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.