ClickhouseProblem & solution
Why we rewrote WAL-G for Postgres backups in Rust: Meet WAL-RUS
Summary
ClickHouse Cloud built WAL-RUS, an open-source Rust implementation of PostgreSQL backup and WAL archival tooling, after encountering difficulty predicting WAL-G’s memory usage in resource-constrained environments. The project preserves WAL-G’s core functionality and compatibility while using bounded worker pools, controlled concurrency, persistent object-storage connections, and a streaming pipeline that limits buffering and data copies. It uses the same WALG_ configuration variables, and WAL-G and WAL-RUS can read each other’s archives. In a sustained WAL-heavy benchmark with four archival workers, WAL-RUS stayed below 1 GB of peak virtual memory versus nearly 2.8 GB for WAL-G, while both maintained minimal backlog and comparable CPU usage. The authors plan to make WAL-RUS the default backup and archival mechanism for ClickHouse Cloud’s managed Postgres offering and are working to upstream its Postgres 17 wal summaries support to WAL-G.
Context
As ClickHouse Cloud scaled Postgres into increasingly resource-constrained environments, WAL-G’s garbage-collected Go runtime made resident and virtual memory usage difficult to predict. The resulting uncertainty encouraged over-provisioning backup infrastructure, reducing the memory confidently available to Postgres and complicating capacity planning, particularly with overcommit disabled.
Approach / What changed
WAL-RUS reimplements Postgres backup and WAL archival tooling in Rust while preserving WAL-G compatibility. It uses bounded worker pools, controlled concurrency, persistent object-storage connections for daemonized archival, and a streaming pipeline that minimizes buffering and data copies. It reuses WALG_ configuration variables, interoperates with WAL-G archives, and supports Postgres 17 wal summaries for incremental backups.
Takeaways
In the benchmark, WAL-RUS remained below 1 GB of peak virtual memory, while WAL-G reached nearly 2.8 GB, reducing peak virtual memory by more than 70%.
WAL-RUS and WAL-G both maintained minimal archival backlog under the sustained WAL-heavy workload; pgBackRest accumulated a larger backlog during periods of intense WAL activity.
WAL-G can read archives generated by WAL-RUS and WAL-RUS can read WAL-G archives, while both tools use the same WALG_ configuration variables.
Source and freshness
- Source
- clickhouse.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.