---
title: "What is WAL backpressure, and why does ClickHouse Managed Postgres need it?"
description: "ClickHouse Managed Postgres prevents WAL-full PANICs, which happen when writes outpace archiving to object storage, by throttling client write bandwidth with the cgroup v2 I/O controller."
url: "https://swe.quest/articles/what-is-wal-backpressure-and-why-does-clickhouse-managed-postgres-need-it-a02421af1a627e86"
canonical: "https://clickhouse.com/blog/wal-backpressure-clickhouse-managed-postgres"
source: "ClickHouse"
published: "2026-08-05"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 4
tags: ["postgres","resilience","linux","storage-systems"]
---

# What is WAL backpressure, and why does ClickHouse Managed Postgres need it?

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-08-05, 4 min read, Deep dive. Original: [https://clickhouse.com/blog/wal-backpressure-clickhouse-managed-postgres](https://clickhouse.com/blog/wal-backpressure-clickhouse-managed-postgres)

## Summary

ClickHouse Managed Postgres prevents WAL-full PANICs, which happen when writes outpace archiving to object storage, by throttling client write bandwidth with the cgroup v2 I/O controller. A systemd timer counts pending WAL segments every 15 seconds and applies tiered write caps of 80%, 50% and 20% of provisioned disk throughput at 100, 500 and 1,000 segments. Processes are sorted by process title into an immune cgroup (archiver, checkpointer, WAL writer, logger) and a throttled one (client backends), and reads are never capped. In a pgbench test with a rate-limited archive\_command, the backlog peaked at 3,433 segments (53 GiB), the disk never passed 33% full, and the backlog drained in under four minutes once storage recovered. One caveat: WAL-heavy workloads see throughput cut much more than WAL production, which fell only about 10%.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)

## Prerequisites

- Postgres write-ahead log ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- WAL archiving and PITR
- Linux cgroups v2 ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))

## Keywords

ClickHouse Managed Postgres, PostgreSQL, WAL, cgroup v2, systemd, pgbench, archive\_command

## Related posts

- [What else runs on your Postgres server, and how do we stop it from taking the database down?](https://swe.quest/articles/what-else-runs-on-your-postgres-server-and-how-do-we-stop-it-from-taking-the-79e9559393b71ab0.md): ClickHouse · 2026-08-21 · Medium · 4 min read · PostgreSQL, Linux, Memory management, Resilience, Multi-tenancy
  Supporting processes on a managed Postgres VM (PgBouncer, WAL-G, Prometheus, exporters, log collector, watchdogs) share memory, CPU and disk with the database, so a leak or CPU burst in any of them can take it down.
- [How we scale PgBouncer in ClickHouse Managed Postgres](https://swe.quest/articles/how-we-scale-pgbouncer-in-clickhouse-managed-postgres-130231ec324c9f46.md): ClickHouse · 2026-07-01 · Medium · 4 min read · PostgreSQL, Performance engineering, Load balancing, Linux, Scaling
  Because PgBouncer is single-threaded, ClickHouse Managed Postgres runs a fleet of PgBouncer processes sized to the core count, all binding one port via so\_reuseport so the kernel load-balances connections behind a single endpoint.
- [What I learned from a month with WalShadow on ClickHouse Managed Postgres](https://swe.quest/articles/what-i-learned-from-a-month-with-walshadow-on-clickhouse-managed-postgres-89e5a8963b72573d.md): ClickHouse · 2026-11-06 · Medium · 16 min read · PostgreSQL, Replication, Event-driven architecture, Analytics & OLAP, Performance engineering
  WalShadow, which decodes physical Postgres WAL outside the database and writes blocks directly to ClickHouse, held median replication latency near 0.4 s from 1 to 200,000 rows/s on a 16 vCPU source.
- [Everyone gets faster writes: We turned off FPW's in Neon](https://swe.quest/articles/everyone-gets-faster-writes-we-turned-off-fpw-s-in-neon-60d0cd25f29077e7.md): Neon · 2026-05-07 · Hard · 7 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases
  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.
- [Building an enterprise Postgres service in ClickHouse Cloud](https://swe.quest/articles/building-an-enterprise-postgres-service-in-clickhouse-cloud-d1a33138c29d5132.md): ClickHouse · 2026-02-20 · Easy · 5 min read · PostgreSQL, Replication, Event-driven architecture, Security
  ClickHouse Cloud's managed Postgres runs on NVMe with up to two cross-AZ synchronous standbys using quorum commit (acknowledged when one standby confirms) and automatic failover.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
