FinOps · Citus
Citus cost optimization: workers sized for the biggest shard, reference tables copied everywhere, and a rebalance nobody ran.
A Citus bill is a node count, and the count is set by the busiest shard, repeated by every reference table and kept high by a rebalance that never happened. This is the FinOps view of those three.
A bill with one dial and three ways to turn it up
Workers were sized for the biggest shard. Reference tables are copied everywhere. We added nodes and never rebalanced. Citus has no price of its own, so every cost sentence about it is a sentence about how many nodes there are and how big each one is. The cost question is the same each time: why does the cluster need this many workers, and what would it need if the work were spread properly?
The answers are structural. Skew sets the size of the busiest worker, and the other workers are sized to match it. Reference tables make every worker larger by a fixed amount. A rebalance that did not run leaves new workers empty while the old ones stay full. This page is the Citus chapter of Postgres FinOps. How the platform reads the coordinator and the workers together is on the Citus solutions page, and the shared method is in the cost optimization overview.
How a Citus cluster adds up
A Citus cluster is a coordinator and a set of workers. Distributed tables are cut into shards, and the shards are spread over the workers, where all of the table data lives. The coordinator keeps the metadata and plans queries, and Citus notes that it needs less memory than a worker. Everything the cluster costs is therefore nodes and the storage on them, and the decisions that change it are where the shards sit and how many workers there are.
Two things multiply what a node holds. Reference tables are replicated to every worker, so they scale with the worker count rather than the data. And shard count, fixed per table, bounds how many workers a table can use at all. The table below states what each part counts and how it behaves. It lists no prices, because the host sets those.
-
Worker nodes
- Behaviour
- metered
- What it means for the bill
- Distributed table data lives on the workers. Each one is a node paid for at its size, wherever it is hosted, so the worker count is the main cost lever, and the size of the biggest shard is what usually sets it.
-
The coordinator
- Behaviour
- flat
- What it means for the bill
- Holds the metadata and plans queries. Citus notes that it needs less memory than a worker, so it can be a smaller and compute-leaning machine.
-
Shard count
- Behaviour
- flat
- What it means for the bill
- Chosen for each distributed table, and it bounds how far the cluster can scale out. For multi-tenant workloads Citus suggests a count that leaves room to grow to many times the current number of workers.
-
Reference tables
- Behaviour
- multiplies
- What it means for the bill
- A single shard replicated to every worker, and written with a two-phase commit. Citus describes them as typically small, so their total size is the table’s size times the number of workers.
-
Rebalancing
- Behaviour
- metered
- What it means for the bill
- Moves shards between nodes in the background using logical replication. Moves run one at a time by default, and running them in parallel trades network bandwidth and resources for speed.
-
Storage per node
- Behaviour
- metered
- What it means for the bill
- Each worker carries its own disk, so skew shows up as one disk filling while the others sit nearly empty.
Storage per worker, and the shard behind the heavy one
When a table is distributed on a column whose values are lopsided, data collects in a few shards, and the nodes holding those shards carry more than the rest. Citus says so directly. In a multi-tenant system the lopsidedness is usually people: tenant sizes tend to follow a long tail, with a few very large tenants and many small ones, and the large ones share a shard, and a worker, with everyone else.
The tiles set the storage on the heaviest worker against a typical one, so the odd one out is visible at a glance. When one worker holds far more than the rest, each worker is sized to match it, and the answer is in what makes it heavy, not in removing the light ones.
Storage skew across workers
illustrativeSix workers. The first carries a large tenant; the rest are sized to match it.
Heaviest worker, holding the largest tenant
about 620 GB
A typical other worker
about 160 GB
Heaviest against typical
about 4 times
Reference tables across every node
A reference table is the Citus answer to a small table that every query joins with: one shard, copied to every worker, so the join never leaves the node. It is a good design, and Citus describes such tables as typically small. The cost is that the copy is multiplied, not shared. A table of twenty gigabytes on a cluster of eight workers is a hundred and sixty gigabytes of storage, and the number rises with every worker you add.
The tables that were small when they were chosen, and are not any more, are the ones to move. They are also the ones that make adding a node slow, since the new node has to receive them. Writes to a reference table are committed with a two-phase commit across the workers, which is a second reason to keep them few.
The rebalance that is still pending
Adding a worker is the first half of scaling out, and the half that is easy to see: a new node appears, it is healthy, and the bill goes up. The second half is moving shards onto it. Citus documents the gap plainly. A new node is available for the shards of new distributed tables, and existing shards stay where they are unless they are redistributed, so adding a worker may not help without further steps. A cluster in that state pays for the new node and gets nothing from it.
The rebalance itself can run online, using logical replication so reads and writes continue, and it needs each table to have a primary key or an explicit replica identity. By default moves run one at a time, and parallel moves trade network and resources for speed. Until it runs, the new workers stay empty while the old ones stay full.
Five problems, in the words people use for them
These are the sentences from the review. Each card links to the page where that part of the platform is covered in depth.
What the product shows: The worker, reference-table and rebalance costs, each priced across the cluster and tied back to the workload that drives it.
Reference tables are copied everywhere.
We added nodes and never rebalanced.
One customer is most of our load.
Adding a node takes longer every time.
Where the rest of the method lives
Citus is the one chapter where the unit of cost is not a service but a topology, and the cluster you read about here can run on a managed platform, such as Azure, or on machines you run yourself. Whatever the host bills, the method is the same: attribute the dollars, queue and gate the fixes, put each number in front of its owner, and read every figure against the basis it carries. For why a node count is a different kind of cost from a metered one, read how Postgres cost works on a fleet.
Questions about Citus cost
What does Citus itself cost?
It is a Postgres extension, and the bill is the nodes and storage it runs on, which depends on where the cluster is hosted. The cost model is therefore the number of workers, their size, the storage on each, and what the host charges around them. That is why the screens count workers, shards and copies rather than a price per query.
Does adding a worker move data to it?
No. Citus documents that a new node is available for the shards of new distributed tables, and that existing shards stay where they are unless redistributed, so adding a worker may not help performance without further steps. The platform shows nodes that hold nothing and what a rebalance would move.
Can a rebalance run without downtime?
Citus describes online shard rebalancing, using logical replication so reads and writes continue, with a brief write lock only when the new shard is promoted. A table needs a primary key or an explicit replica identity to be moved. Moves run sequentially by default, and parallelism is available at the expense of more network bandwidth and resources.
Why are reference tables a cost?
A reference table is one shard replicated to every worker, so its footprint is its size multiplied by the number of workers. Citus describes them as typically small, which is when that is fine. The exceptions are the tables that were small once, grew, and are now copied to every node.
Will it add workers or start a rebalance for me?
No. A node change or a rebalance is a recommendation with its dollar delta and its basis, proposed as a governed action. A person approves it and the ledger records who did. A rebalance moves a lot of data, and it goes through the approval gate like any other change.
See which Citus workers are sized for one shard.
A pilot starts read-only and shows storage per worker, the reference-table footprint and any rebalance that was never run, all modeled and labelled with their basis.