Capacity Planning
This page turns your load into a deployment: how many nodes, how much database, and where adding nodes stops helping. Every number on it is written from a committed benchmark report when the documentation is built, and names the build, the CPU and the JDK it was measured on. For what Wow does with a command and how it compares, see Performance; for what a node does under load, Scaling and Capacity.
- Four inputs, three tables, then the formulas. The worked example runs through them once.
- Every figure was measured on stated hardware, with the database, Kafka and the load generator on the same machine as the nodes. When the numbers transfer says when they hold for yours, and how to measure your own.
What was measured
The domain is the benchmark's own: accounts, and a transfer between two of them run by a saga (test/benchmarks/server).
| Scenario | What one operation is | Answered when |
|---|---|---|
| E1 write | A deposit to one account | Its commit is stored |
| E2 read your write | A deposit, then a read of the account's state | The read shows the deposit's version |
| E3 saga step | A transfer prepared on one account | The saga's entry on the other account is stored |
| E4 read | One account's state by id, or a page of ten accounts | The answer |
| Mixed | Writes and reads together: half E1, the rest E4 | Each as its scenario |
| Large | E1 with five events of about 2 KB each | As E1 |
On GitHub Actions each suite runs on a 4-core runner of its own, whose CPU model its row names. On the Apple M5 Max (18 cores, 64 GB) the stores run in containers on the same host.
1. Your four inputs
| Input | What to bring |
|---|---|
| Rate | Commands a second at your busiest hour, by kind: writes, saga steps, point reads, lists |
| Aggregates | How many exist, and how many are touched in an hour (the hot set) |
| History | Commits a day, and how long the log is kept (forever by default) |
| Size | The size of a state, and of a command's events |
2. Unit costs per command (T1)
Read the rate column first
Wow batches: commands queued for one aggregate commit together, and the appends of several partitions merge into one statement. So the cost of one command falls as the rate rises, and a cost measured at a high rate, multiplied by a light load, gives too small an answer. Take the row measured nearest your rate; between two rows, the cost of the lower rate.
One node at 100,000 accounts. A row with a rate alone is the median of beta.6's three L3 rounds of the suite, at the rate the suite's calibration chose, with the node pinned to one core and PostgreSQL or MongoDB and Kafka to one core each; its CPU is split between them. A row "sustainable" is the L4 rate of T2, whose CPU is the three together. The Large write is five events of about 2 KB; Mixed is half E1 writes, half E4 reads. Commits and WAL bytes are PostgreSQL's per command.
CPU in ms per command. Build e3a4e937aa, JDK 25.0.5+8; each row names its runner's CPU. A dash is a figure the L4 suite does not split or count.
PostgreSQL
| Workload | Rate | Node | Database | Kafka | All three | Commits | WAL bytes | Runner |
|---|---|---|---|---|---|---|---|---|
| E1 write | 1,487.5/s | 0.579 | 0.431 | 0.335 | 1.34 | 0.674 | 1,132 | Xeon 8573C |
| E1 write | 1,957.8/s, sustainable | – | – | – | 1.33 | – | – | EPYC 7763 |
| E3 saga step | 478.7/s | 1.678 | 1.487 | 1.019 | 4.2 | 2.065 | 4,222 | EPYC 7763 |
| E3 saga step | 839.9/s, sustainable | – | – | – | 3.34 | – | – | EPYC 7763 |
| Large write | 546.4/s | 1.152 | 1.096 | 0.948 | 3.2 | 1.461 | 13,033 | EPYC 9V74 |
| Mixed | 1,515.5/s | 0.61 | 0.363 | 0.295 | 1.28 | 1.064 | 610 | Xeon 8370C |
MongoDB
| Workload | Rate | Node | Database | Kafka | All three | Runner |
|---|---|---|---|---|---|---|
| E1 write | 1,771.1/s | 0.344 | 0.503 | 0.244 | 1.09 | EPYC 9V74 |
| E1 write | 2,975.1/s, sustainable | – | – | – | 0.95 | Xeon 6975P-C |
| E1 write, Zipf keys | 2,232.6/s | 0.335 | 0.408 | 0.186 | 0.93 | EPYC 9V45 |
| E2 read your write | 869.8/s | 0.736 | 1.004 | 0.476 | 2.21 | EPYC 9V74 |
| E2 read your write | 1,272.2/s, sustainable | – | – | – | 2.2 | Xeon 6975P-C |
| E3 saga step | 375.2/s | 1.54 | 2.584 | 1.273 | 5.35 | EPYC 7763 |
| E3 saga step | 1,008.3/s, sustainable | – | – | – | 2.8 | Xeon 6975P-C |
| Large write | 1,048.4/s | 0.505 | 0.771 | 0.375 | 1.65 | EPYC 9V45 |
| Mixed | 1,843.3/s | 0.405 | 0.505 | 0.22 | 1.13 | EPYC 9V45 |
MongoDB's commits and journal bytes per command were not measured.
The rows come from the actions-snapshot report; each runner's CPU model differs, so two rows on different models are not a comparison.
Per aggregate, on PostgreSQL (Wow in the larger of the two sessions of the axon-pg suite in the actions-axon report, build 3fd5349050, EPYC 9V74):
- an event in the log takes 627 bytes, indexes included;
- a snapshot, one an aggregate, rewritten in place, 441 bytes.
Not measured: the bytes per event and per snapshot on MongoDB; the heap a cached state takes; a cache miss as a cost of its own (the cold-cache rows of T2 show its effect on latency); and what a subscription costs.
3. One node's sustainable rate (T2)
The highest rate with p99 within 200 ms: with at most 1% errors on the runner, found by bisection in open loop; with no error on the workstation, the best step of a closed-loop sweep. On the runner the node, the database and Kafka share 3 of its 4 cores, and the load generator has the other 1.
Each figure is from the build, the JDK and the runner its row names. The scenarios are those of What was measured.
GitHub Actions, one 4-core runner a suite: actions-snapshot, build e3a4e937aa.
These rows ran on 2 CPU models, which each row names: two rows on different models do not compare the stores, nor the scenarios.
| Store | Nodes | Scenario | Keys | Peak | Sustainable | CPU, JDK, build |
|---|---|---|---|---|---|---|
| MongoDB | one | E1 | uniform | ≥ 5,010.8/s, closed loop | 2,975.1/s, open loop, p99 198.7 ms | Xeon 6975P-C, JDK 25.0.5+8, e3a4e937aa |
| MongoDB | one | E2 | uniform | 2,261.6/s, closed loop | 1,272.2/s, open loop, p99 190.5 ms | Xeon 6975P-C, JDK 25.0.5+8, e3a4e937aa |
| MongoDB | one | E3 | uniform | 1,466.6/s, closed loop | 1,008.3/s, open loop, p99 173.1 ms | Xeon 6975P-C, JDK 25.0.5+8, e3a4e937aa |
| PostgreSQL | one | E1 | uniform | 4,474.9/s, closed loop | 1,957.8/s, open loop, p99 139.3 ms | EPYC 7763, JDK 25.0.5+8, e3a4e937aa |
| PostgreSQL | one | E3 | uniform | 1,493.1/s, closed loop | 839.9/s, open loop, p99 190.5 ms | EPYC 7763, JDK 25.0.5+8, e3a4e937aa |
Apple M5 Max, 18 cores, 64 GB, one host: m5max-snapshot, build 103f9b6746.
| Store | Nodes | Scenario | Keys | Peak | Sustainable | CPU, JDK, build |
|---|---|---|---|---|---|---|
| MongoDB | one | E1 | one hot account | 9,948.1/s, at 256 clients | 9,948.1/s, at 256 clients, p99 78.8 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| MongoDB | one | E1 | uniform | ≥ 28,609.4/s, at 4,096 clients | 28,196.1/s, at 1,024 clients, p99 66.6 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| MongoDB | one | E1 | Zipf | 15,957.5/s, at 1,024 clients | 14,914.4/s, at 256 clients, p99 42.2 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| MongoDB | one | E3 | uniform | 7,738.2/s, at 1,024 clients | 5,898.6/s, at 256 clients, p99 72.2 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | one | E1 | one hot account | 11,853.7/s, at 256 clients | 11,853.7/s, at 256 clients, p99 76.8 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | one | E1 | uniform | ≥ 41,706.1/s, at 4,096 clients | 41,706.1/s, at 4,096 clients, p99 167.9 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | one | E1 | Zipf | 19,746.8/s, at 256 clients | 19,746.8/s, at 256 clients, p99 29.6 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | one | E3 | uniform | 8,042.7/s, at 1,024 clients | 3,637.9/s, at 64 clients, p99 185.3 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
Three nodes on this one host: the nodes, the stores and the load generator divide the same cores, so these rows show what a cluster costs (forwarding between the nodes), not what it gains. Scaling across separate machines has not been measured.
| Store | Nodes | Scenario | Keys | Peak | Sustainable | CPU, JDK, build |
|---|---|---|---|---|---|---|
| MongoDB | 3 | E1 | uniform | 19,052.3/s, at 1,024 clients | 19,052.3/s, at 1,024 clients, p99 131.1 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| MongoDB | 3 | E3 | uniform | 6,060.2/s, at 1,024 clients | 5,462.9/s, at 256 clients, p99 78.8 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | 3 | E1 | uniform | 25,104.3/s, at 1,024 clients | 25,104.3/s, at 1,024 clients, p99 90.6 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
| PostgreSQL | 3 | E3 | uniform | 8,623/s, at 1,024 clients | 7,279/s, at 256 clients, p99 59.6 ms | Apple M5 Max, JDK 25.0.5+8, 103f9b6746 |
A cold cache
With 1,000,000 accounts and nothing cached, one node on the runner (build e3a4e937aa; runners Xeon 6975P-C for PostgreSQL and EPYC 9V74 for MongoDB) answered writes at 200/s within a p99 of 5.1 ms on PostgreSQL and 154.6 ms on MongoDB.
How a node's rate moves with cores: two hardware classes were measured, not a curve. Between them, go by the CPU a command costs (T1), not by the core count alone.
4. Ceilings (T3)
Limits that more nodes do not raise.
| Ceiling | What was measured | What to do at it |
|---|---|---|
| One aggregate | One hot account on the workstation peaked at 11,853.7/s on PostgreSQL and 9,948.1/s on MongoDB (build 103f9b6746, Apple M5 Max) | Spread the load over aggregates |
| One partition with many aggregates | Not measured | Choose the partition count before the first deployment (Nodes and partitions) |
| The database | Its CPU per command, in T1 | A bigger or less shared database; MongoDB sharding; another aggregate type's log on another store |
| Connections | Not a measurement: each node's pools, plus one pool, within max_connections | Size the pools |
| A sink | Not measured here | Its added load on the log's database is not measured |
| A subscription that lags | Not a rate: wow.subscription.backlog | A faster handler, or more nodes (Subscriptions) |
5. From inputs to a deployment
Nodes = the larger of:
- ⌈Σ rate ÷ (its sustainable rate in T2 × 0.6)⌉, so each node runs at about 60% of its sustainable rate;
- ⌈Σ rate × node CPU ms (T1) ÷ (1,000 × cores a node × 0.6)⌉;
plus one, so a lost node's partitions fit on the others.
Database CPU, in cores = Σ rate × database CPU ms (T1) ÷ 1,000.
On PostgreSQL, commits and WAL a second = Σ rate × commits, and Σ rate × WAL bytes (T1).
Log storage = events a day × bytes per event × days kept; snapshots = aggregates × bytes per snapshot (T1's per-aggregate figures). Count events, not commands or commits: a command writes one event or more, and one commit can hold several commands. In the benchmark's domain a deposit (E1) writes one event; a transfer (E3) writes four, two when prepared, one when entered and one when confirmed; and the Large write five of about 2 KB each, which the bytes per event above, measured on small events, do not cover.
Heap = the hot set × the heap a cached state takes (not measured), × 10 while the state cache is a tenth of the heap (What Wow derives), plus the commands in flight.
Partitions: Nodes and partitions has the rule.
A node's first half minute after start is not its steady state. On the runner (build e3a4e937aa, EPYC 9V45, MongoDB, 1,000 accounts not primed), a fresh node taking E3 at 423.9/s used 1.00 of its one core, while MongoDB used 0.65 of its own. Its p50 was 2,637.8 ms at second 10 and 41.2 ms at second 39. After 120 s, the same rate took 0.49 of the core. So a rolling restart needs CPU headroom for each node that rejoins: for its first half minute it takes more of its core than it later needs for the same rate.
6. A worked example
Computed by the generator from T1 and T2, as the formulas above; each output names the rows it read.
The inputs: a context on PostgreSQL taking, at its busiest hour, 2,000 writes (E1, 1 event each) and 500 transfers (E3, 4 events each) a second. Its average over a day is 1/4 of that peak. It holds 2,000,000 accounts and keeps its log 3 years.
| Output | Value | From |
|---|---|---|
| Nodes, by sustainable rate | 162% of one node's sustainable rate: 3 at 60% each, and one more for a lost node's partitions, 4 | T2: E1 write, PostgreSQL, 1,957.8/s, EPYC 7763, e3a4e937aa; T2: E3 saga step, PostgreSQL, 839.9/s, EPYC 7763, e3a4e937aa |
| Node CPU | 2 cores; 3.33 at 60% | T1: E1 write, PostgreSQL, 1,487.5/s, Xeon 8573C, e3a4e937aa; T1: E3 saga step, PostgreSQL, 478.7/s, EPYC 7763, e3a4e937aa |
| Database CPU | 1.61 cores | T1: E1 write, PostgreSQL, 1,487.5/s, Xeon 8573C, e3a4e937aa; T1: E3 saga step, PostgreSQL, 478.7/s, EPYC 7763, e3a4e937aa |
| Commits a second | 2,381 a second | T1: E1 write, PostgreSQL, 1,487.5/s, Xeon 8573C, e3a4e937aa; T1: E3 saga step, PostgreSQL, 478.7/s, EPYC 7763, e3a4e937aa |
| WAL a second | 4.38 MB a second | T1: E1 write, PostgreSQL, 1,487.5/s, Xeon 8573C, e3a4e937aa; T1: E3 saga step, PostgreSQL, 478.7/s, EPYC 7763, e3a4e937aa |
| Events a day | 86,400,000 | the inputs: Σ rate at the peak × events a command × 86,400 ÷ the peak-to-average ratio |
| Log storage over 3 years | 59.3 TB | 627 B per event, the actions-axon report, Wow on PostgreSQL, EPYC 9V74, 3fd5349050 |
| Snapshots | 0.9 GB | 441 B per snapshot, the actions-axon report, Wow on PostgreSQL, EPYC 9V74, 3fd5349050 |
The example shows the method, on named rows; it is not a sizing. Its node and database CPU add costs measured on two CPU models, the E1 row on Xeon 8573C and the E3 row on EPYC 7763, and its byte figures come from an earlier build, named beside them. Size from rows measured on your own hardware class (how to measure your own). The node count is for the runner's class of node, where the database shares the machine; on a node of its own, go by the node CPU instead. Heap is not computed, because the heap a cached state takes was not measured.
7. Where it stops scaling
Nodes add throughput until the database is full.
- The bound: the service's rate ≤ the database's CPU ÷ the database CPU per command (T1). Past it, more nodes add nothing; the next step is a bigger or less shared database.
- Then a hot aggregate, at its ceiling (T3) whatever the node count.
- Then one aggregate type's log on one database; splitting it is planned for 10.x.
Scaling across separate machines was not measured. The three-node runs share one machine with the database, so they show what a cluster costs, not what it gains. To measure it on your own machines, run the same E1 sweep against 1, 2 and 4 nodes on separate hosts with one database, and read where the database's CPU reaches its limit.
8. When the numbers transfer, and how to measure your own
The figures hold for:
- a node of the stated hardware class, with the database, Kafka and the load generator beside it;
- PostgreSQL or MongoDB as the benchmark harness starts them (
compose.yml); - the benchmark's small events and states (large payloads by T1's Large row);
- uniform keys unless named;
- JDK 25, a 1 GB heap, G1;
- Kafka publishing on.
Your own, on your hardware, from the repository root with Docker and a JDK 25:
test/benchmarks/harness/bench.sh build
test/benchmarks/harness/bench.sh up --backend=postgres --accounts=100000 --prime
test/benchmarks/harness/bench.sh saturate --reuse --backend=postgres --accounts=100000 --scenario=E1 --sweep
test/benchmarks/harness/bench.sh run --reuse --backend=postgres --accounts=100000 --scenario=E1 --rate=1000
test/benchmarks/harness/bench.sh downThe sweep gives T2's figure for your machine; a run at your own rate gives T1's. On GitHub's runners, gh workflow run bench.yml -f tier=L4 -f head_ref=<tag>. The benchmark guide explains the harness and every suite, and test/benchmarks/results/reports/ keeps the reports these figures come from, each with its raw results.
Comparing two builds. A comparison runs both builds in turn on one runner, and calls a latency ratio beyond noise only when its whole 95% interval clears the suite's A/A threshold. One L3 run can therefore flag only a large latency change, of the order of its own intervals' width; the reports README gives the sizes per metric. A change of 10 to 20% needs an alternating run with more rounds. CPU and allocation per operation are reported as ratios with no threshold: nothing judges them beyond noise.