Performance methodology: tree size
This page is part of the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at performance-methodology-tree-size.md, and llms.txt lists every page.This page explains how the tables in Performance: tree size are produced. The ladder runs on the Layer 3 rig and reuses its seeding, grading and storage metrics, which Layer 3 methodology describes. This page covers only what differs.
What it measures
As one tree grows, how does a client's point-read latency change, and how long does it take to load the tree to that size? Each rung of the ladder is a tree size. For each rung the page reports:
- the seed segment (keys added at this rung), its seed time and seed rate;
GetAsynclatency at p50, p95, p99 and p99.9;- how many reads were measured;
- peak silo CPU and memory.
The results page's summary names the first degraded rung: the first whose
p95 is at least -KneeFactor (1.5) times the baseline (smallest) rung's p95.
How it differs from a Layer 3 cell
| Layer 3 cell | Tree-size rung | |
|---|---|---|
| Independent variable | Silo count | Keys in the tree |
| Workload | Every workload | get-point only |
| Silos | 1-8 | 4 (-LadderSilos) |
| Keyspace read | One key per simulated vehicle | Every key seeded so far, uniformly |
| Cohorts | Median of up to three per cell, fresh storage each | One execution for the whole ladder |
| Published latency | Silo-side per-call quantiles | Client-side GetAsync timings |
The rig is as in The rig, with 64 shards, 16 WAL partitions and 245-byte values. The offered read load is 125 vehicles per silo at 5 Hz: 2,500 reads/s on 4 silos, held constant across rungs so only the tree size changes.
The ladder
benchmark/tree-size-report.ps1 drives
run-cohort-aca.ps1 -WorkloadMode get-point -TreeSizeLadder <sizes>, which
runs the whole ladder in one producer execution. The sizes must be strictly
ascending. For each rung the producer:
- Seeds the keys between the previous rung and this one, with the bulk load described under How a cohort is graded. One tree grows from rung to rung, and no key is written twice.
- Reads for
-DurationSec(60 s), each key taken by a fixed prime stride that spreads reads evenly over every key seeded so far. - Logs
tree-size-rung index=.. rung=.. phase=seed|measure|end, so the log splits into one segment per rung, each with its own latency, verification andFINALlines.
Storage is reset once, before the first rung. Seed time is the producer's
wall clock across the rung's seed, retries included. A seed has no overall time
limit: it fails when no chunk lands for -PreseedStallSec, or when one chunk
fails eight times or with a non-transient error.
Why reads run on the warm cluster
The silos that seeded a rung stay up to read it. A bulk-loaded leaf's
checkpoint is the WAL position at which it was loaded, so a tree opened by
freshly started silos replays the WAL appended since, leaf by leaf,
serialised per partition. Reading on a cold cluster would
measure that recovery, not steady-state reads. For the same reason the
silos keep the Orleans default grain collection age
(-GrainCollectionAgeSec 0): a shorter age speeds the seed but makes every
reactivated leaf replay its WAL partition.
Read latency
The producer times each GetAsync from issue to completion, so every figure
includes the client-to-silo hop. Samples land in logarithmic buckets about
4.4% wide, and each published quantile is the upper edge of the bucket
it falls in, so it can overstate the true value by up to one bucket width.
- Steady: samples from 15 s into the read window to its end. This is the published figure.
- Total: every sample, logged alongside it but not published.
The steady window still contains first-touch leaf activations: a uniform read over millions of keys keeps reaching leaves it has not read before. That is what drives the multi-second p99.9.
Read verification
Every read is checked against the value seeded for its key, without an
extra storage round trip, and logged as
read-verify-final verified=.. mismatch=.. missing=... A rung with any
mismatched or missing key is flagged INCONSISTENT in its row and cannot be
the baseline or the degraded threshold. That is the only hard gate on a rung.
Silo CPU and memory
Peak CPU and peak memory are the highest one-minute Azure Monitor
UsageNanoCores and WorkingSetBytes maxima across the silo replicas,
between the rung's seed and end markers. Each is also shown as a share of
the replica limit (4 vCPU, 8 GiB). The window includes the seed, so the
peak usually comes from seeding, not reading.
What bounds these numbers
What bounds these numbers applies in full. In addition:
- Seed rate. One storage account seeds about 1,100-1,500 keys/s, so
seed time grows roughly linearly with segment size.
run-cohort-aca.ps1 -WalAccounts, whichtree-size-report.ps1does not pass through, may raise it. - Silo memory. Working set grows with tree size, and the 8 GiB replica cap bounds the largest tree a fixed silo count can hold.
- One cohort per rung unless
-Repeatsis raised. Treat a difference under about 15% between rungs as noise. - Uniform reads are the worst case for leaf residency. A skewed workload keeps a hot set active and reads faster.
- Reads only. Nothing writes during a read window.
Re-running it
As in Re-running it, with
the ladder in place of a silo sweep. From benchmark/:
./tree-size-report.ps1 -NamePrefix <prefix> -SiloCounts 4 -LadderSilos 4 `
-Sizes 1000000,3000000,6000000,10000000 -VehiclesPerSilo 125 -DurationSec 60
Useful options:
-Resumecontinues a sweep that stopped;-DryRunre-renders the page frombenchmark/.run/tree-size-report/<prefix>/state.json.-Repeats Nruns N independent ladders per silo count; the table then shows the median of each quantile.-KneeFactor,-SpreadGatePctand-SpreadFloorMstune the grading.-PreseedStallSec(default 900) and-PreseedKeysPerSecFloor(default 250) bound the seed and the producer execution ceiling.