Resources & budgets
In one line: a live utilization map of the engine — enough real-time data to see pressure building and throttle before you hit a limit, instead of meeting the ceiling as an exception.
You set the budgets once, at startup, through ResourceOptions — page-cache size, max active transactions, WAL ring/segment sizing, checkpoint thresholds — and Validate() checks that the fixed allocations actually fit the total. From then on every significant resource (page cache, transactions, WAL, allocators, timers, …) sits in a fixed tree and reports its own utilization. Reporting is pull-based: metrics are read when you take a snapshot, never pushed on the hot path — so having the map costs nothing while you aren't looking at it.
Why this earns a page: a budget is a ceiling, and hitting one isn't negotiable — it surfaces as a ResourceExhaustedException. The graph is what lets you not get there: it says how close you are right now, so you can shed load, slow your input, or throttle while there's still room. And when something does saturate, FindRootCause matters more than the raw number — the node that looks busiest is usually a symptom, so it walks the dependency chain back to whatever is actually backed up, letting you throttle the right thing instead of guessing.
⚠️ The engine does not auto-throttle off this graph. Overload management reacts to tick overrun, not resource metrics — separate signals. This graph is the data; acting on it (health checks, alerts, shedding) is the host's job. Related caveat:
ExhaustionPolicycurrently documents intent rather than switching behaviour at runtime.
How it relates
- Errors & failures — the wall: exceeding a budget throws
ResourceExhaustedException. - Overload management — the engine's own automatic degradation, on a different signal (tick overrun).
- Observability & telemetry — the bridge that projects this tree into OTel metrics, health checks, and alerts.
- Page cache & paged store — usually the largest budget you will set.
In the API
ResourceOptions— the startup budgets;Validate()checks they fit the total.IResourceGraph.GetSnapshot()→ResourceSnapshot, withFindMostUtilizedandFindRootCause.ResourceExhaustedException·ExhaustionPolicy.
Learn & use
- Feature detail: Resources — budgets & options · exhaustion policy · snapshot & query · root-cause analysis · OTel / health bridge
- Narrative: Guide ch.6 — operating