The auditor
Run and size the background process that reorganizes stored records and reclaims storage.
The auditor is the background process that keeps storage tidy. It copies each stream's records out of the shared write objects into objects of its own, deletes what trim, retention, and stream deletion leave behind, and finishes the work a stopped node left open. It runs inside every novad by default. Appends never wait for it, so a slow auditor costs storage, not latency: shared write objects and their metadata rows pile up until it catches up.
The quickest view of its work is its queues, here through the admin bridge on a node:
curl -s localhost:9191/admin/api/ListAuditQueues -d '{}'{
"queues": [
{
"jobType": "retention",
"depth": "2",
"oldestReadyAtUnixMs": "1795378383538"
},
{
"jobType": "denorm",
"depth": "2"
},
{
"jobType": "teardown",
"depth": "1",
"oldestReadyAtUnixMs": "1795375120737"
}
]
}Empty queues are left out here. The list covers seven of the auditor's queues, and counts each one's depth up to 1,000 (depthCapped says when it stopped). denorm, gc, and orphan show no oldest time, because their keys carry no ready time.
A job waits in its queue until its ready time, so depth alone is normal. What matters is how far past due the oldest job is: nova_auditor_due_age_seconds{queue}. It also covers recovery, trimcheck, star-reclaim, and range-split, which the list leaves out. Auditor delays says what each queue's age means.
What it does
The auditor registers 14 duties, each with its own queue. In plain terms:
| Work | Duties | Why it matters |
|---|---|---|
| Copy records into per-stream objects | denorm | Lets the shared write objects be deleted; must keep up with ingest |
| Delete copied write objects | trimcheck | Frees the WAL's storage |
| Apply trim and retention | retention, retention-check | Makes old records unreadable, then reclaimable |
| Delete objects nothing references | reap, gc, orphan | Frees storage and catches objects a crash left behind |
| Delete streams | teardown, teardown-final | Removes a deleted stream's records and metadata |
| Finish a stopped node's writes | recovery | Indexes records a node acknowledged before it stopped |
| Clean up a retired node | star-reclaim | Deletes a decommissioned node's ledger records and leftover objects |
| Scalable streams | range-intent, range-split, range-merge | Finishes range changes |
Duties explains each one, and Stream objects and denorm the copy.
Where it runs
| Mode | Flag | What runs | Use when |
|---|---|---|---|
| Beside serving | --audit=on (default) | Every node runs an auditor with its own metadata and storage clients | Small and medium clusters |
| Serving only | --audit=off | The node serves and takes no background work | Serving nodes in a split deployment |
| Auditor only | --audit=only | Background work only: the process does not register as a serving node or lead streams | A dedicated pool, when background I/O competes with appends |
Auditors share work through a ring in the metadata store, so they need no stable identity and you can add or remove them freely. An --audit=only process is ready once its ring announcement is live. It refuses to start over object storage without --auditor-fetch-cache-dir.
Split the work when the auditor's downloads and uploads compete with appends for network: run the serving nodes with --audit=off and a pool with --audit=only. On Docker Compose:
NOVA_AUDIT=off docker compose --profile audit-split \
-f deploy/docker/docker-compose.yml up -d --buildOn Kubernetes, the controller runs the pool from the cluster resource's audit section; see Size the pool on Kubernetes.
Size and tune it
Denorm is the work that must keep up: it moves every byte written, once. Size the auditor's bandwidth and request budgets for the sustained write rate, with margin, then watch nova_auditor_due_age_seconds{queue="denorm"}. Everything else is small beside it.
Budgets
Four rate limits pace the auditor's storage work. Each allows a burst of one second's budget.
| Flag | Default | Meters | Scope |
|---|---|---|---|
--auditor-s3-budget | 50 req/s | Probe reads, writes, deletes, and direct source reads | Per auditor process |
--auditor-rewrite-mib | 64 MiB/s | Bytes downloaded or uploaded through the process; server-side copies of chunks of 5 MiB or more do not count | Per auditor process |
--auditor-delete-budget | 1,000 keys/s per bucket | Every key deleted; a batch delete counts each key | Shared by all auditors |
--auditor-read-budget | 10,000 req/s per bucket | Every GET, LIST, and copy part, paid before it is sent | Shared by all auditors |
For the two shared budgets, each auditor takes an equal share. It starts at a tenth of its share, and halves its rate and pauses each time S3 throttles it or the object cache refuses it. --auditor-read-concurrency (64) caps the reads one auditor holds open.
To see which budget holds the auditor back, read nova_auditor_budget_wait_seconds by resource: requests for the request budget, rewrite_bytes for the bandwidth budget. The Auditor dashboard charts it beside the delete- and read-budget rates and throttles.
Denorm books a group's whole cost on the request and bandwidth budgets before it moves a byte. When the wait would outlast the job's time, the group shrinks, or the job pauses: it keeps the work it committed, and its marker stays for the next job. nova_auditor_denorm_budget_holds_total counts these by outcome. A climbing paused count means the budgets set how fast denorm drains: raise --auditor-rewrite-mib and --auditor-s3-budget, or add auditors. A climbing dropped count means groups no longer fit into a stream's last object and are written as objects of their own, so small objects pile up; no records are lost. Denorm also keeps its per-record state within --auditor-denorm-memory-mib: a quarter of the container's memory limit by default, or 512 MiB when there is none. A steady nova_auditor_denorm_memory_waits_total means that budget, not the work, paces denorm. Stream objects and denorm explains the booking.
Writes come first. When S3 throttles a node's WAL write, the node reports storage pressure for that storage class for 30 seconds. While any node reports it, and for a minute after, every auditor pauses that class's deletes. Denorm continues. nova_auditor_deletes_suspended shows which buckets are paused.
Workers
| Flag | Default | Effect |
|---|---|---|
--auditor-workers | 2 | Concurrent jobs per process; one duty holds at most half of them, at least one |
--auditor-markers-per-era | 1 | Ready denorm markers of one ledger gathered into one job |
--auditor-member-parallel | 8 | Streams copied at once inside one denorm job |
More workers help when jobs wait on metadata latency and the budgets have room. Once a budget is used up, more workers add memory and lease traffic, not throughput.
The fetch cache
A write object holds many streams. Without a cache, denorm reads it once per stream, by range. The fetch cache downloads each object whole to local scratch, once, and every stream in it reads from there. Run auditors with it.
| Flag | Default | Notes |
|---|---|---|
--auditor-fetch-cache-dir | off | Turns the cache on. Start wipes the directory, so point it at dedicated scratch, never at data. |
--auditor-fetch-cache-mib | 40960 | Scratch the cache may use; a read that does not fit uses a ranged GET. Below twice the workers times 64 MiB, the node refuses to start. |
--auditor-fetch-parallel | 64 | Downloads at once, warming the next objects |
Cached files are disposable. Downloads count against the request and bandwidth budgets.
A node that runs an auditor beside serving over object storage, without the cache, logs a warning at start: novad: the auditor has no fetch cache: denorm reads every slice of every WAL object with its own GET and falls behind ingest past a few MiB/s; give it --auditor-fetch-cache-dir.
Grace periods and timers
| Flag | Default | Rule |
|---|---|---|
--auditor-read-grace | 10m | Wait between an object's last reference going and its delete. Keep it above twice any reader's cached-footer lifetime. A read plan, the list of objects a node gives the Gateway to read directly, lasts half of it. |
--auditor-orphan-grace | 1h | Age at which an unresolved write intent is judged; keep it above the slowest valid publish |
--denorm-linger | 5m | Wait after a stream crosses 8 MiB before its records are copied |
--denorm-age-cap | 24h | Longest a Standard record stays in a shared write object |
--express-denorm-age-cap | 1h | The same for Express, whose storage costs more |
--denorm-output-cap-mib | 256 | Largest object denorm writes |
A shorter read grace frees storage sooner but gives the Gateway's direct reads less time. The Compose stack uses 2m, so its read plans last 1m. Busy streams are normally copied at the linger; the age cap catches quiet ones. If busy streams keep reaching the age cap, denorm is behind.
Raise capacity gradually
The auditor and the serving nodes share the metadata store, and the auditor's metadata calls have no separate limit. A burst of background work that becomes due together can raise metadata write latency enough to delay the indexer, and then appends wait. Raise workers, budgets, and --auditor-markers-per-era one step at a time, watching metadata write p99, nova_wal_backlog_stall_total, and the due ages.
Size the pool on Kubernetes
The controller renders the auditor pool from the cluster resource's audit section:
| Field | Default | Meaning |
|---|---|---|
replicas | none | Pool size; scaling down is an ordinary delete |
s3Budget, rewriteMiB | the node defaults | Per-auditor request and bandwidth budgets |
slice.scratch | 300Gi | Fetch-cache disk; the cache uses 90% of it. Under 50Gi, zero included, no auditor is rendered and AuditScratchTooSmall says why. |
autoscale.min, autoscale.max | none | Bounds for the sizing loop |
autoscale.ageThreshold | 5m | Due age past which cleanup counts as behind |
autoscale.busyPercent | 50 | With overdue work, utilization at or above it adds an auditor; below it, scaling pauses and reports AuditWedged |
autoscale.lowWaterPercent, autoscale.scaleDownAfter | 30, 30m | Healthy queues and low utilization this long remove an auditor |
The reference slice is 3.5 Gbps of network, 4 CPUs, 8Gi of memory requested and 12Gi as the limit, and 300Gi of scratch. Size scratch to about the ingest times the linger, shared across the pool. For bandwidth, count each write object downloaded once plus each output uploaded, and set rewriteMiB times replicas above that with margin.
If it goes wrong
| Symptom | Likely cause | What to do |
|---|---|---|
NovaAuditorsAbsent fires: no nova_auditor_due_age_seconds series at all | No auditor runs: every node has --audit=off, or the pool has no running pod | Start an --audit=only pool. On Kubernetes, check the pool's pods and the AuditScratchTooSmall condition |
AuditScratchTooSmall on the cluster resource, and no auditor pods | slice.scratch is under 50Gi | Raise it; the controller renders the pool again |
The node exits at start, naming --auditor-fetch-cache-dir | An auditor-only process over object storage without the fetch cache | Set --auditor-fetch-cache-dir to dedicated scratch |
The node exits at start, naming --auditor-fetch-cache-mib | The cache is smaller than twice the workers times 64 MiB | Raise --auditor-fetch-cache-mib to the number the error names, or lower --auditor-workers |
nova_auditor_due_age_seconds{queue="denorm"} climbs | Denorm is slower than ingest, or one ledger is stuck | Follow Denorm falls behind |
Metadata write p99 and nova_wal_backlog_stall_total rise after you raised auditor capacity | Background work competes with the indexer for the metadata store | Step workers or budgets back; see Raise capacity gradually |
The two start errors read:
novad: invalid configuration: --audit=only over object storage needs --auditor-fetch-cache-dir: without a fetch cache, denorm reads every slice of every WAL object with its own GET and falls far behind ingest
novad: invalid configuration: --auditor-fetch-cache-mib: 100 MiB leaves each of 2 workers' denorm walks under 64 MiB of read-ahead; give it at least 256