Dagster on Kubernetes: Why Adding More Nodes Won't Fix a Hidden PostgreSQL BottleneckBrief · digest for November 25
Brief≈ 1 min

Dagster on Kubernetes: Why Adding More Nodes Won't Fix a Hidden PostgreSQL Bottleneck

Pipelines stall, the UI barely responds, and queues pile up. The natural instinct is to add Kubernetes nodes and bump pod CPU and memory limits. With Dagster, that move often backfires: you throw more hardware at the cluster, yet the orchestrator keeps choking.

The culprit is the shared PostgreSQL metadata database (storage.postgres). Three consumers hammer it at once: the web UI reads run history and asset graphs, a single dagster-daemon (running at replicas: 1 so schedules and sensors don't collide) polls QueuedRunCoordinator and sends heartbeats non-stop, and run pods spawned by K8sRunLauncher pour in detailed per-step event logs. There's no aggressive built-in log cleanup. Tables bloat, queries hit locks and disk IOPS limits, and Postgres fails with too many clients already. Spinning up more pods only makes it worse.

You fix this on the database side, not the cluster. Move PostgreSQL out of the Helm chart's bundled container onto a dedicated instance with disk and IOPS monitoring, put PgBouncer in transaction pooling mode in front of it, and cap parallel runs with max_concurrent_runs. Add regular cleanup for old event logs and a sensible max_connections setting, and your orchestrator will run smoothly again.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 2