Node limits and budgets

Node limits and budgets

The memory plan, every bound on a Nova node, and what a client sees when one is reached.

Every buffer, cache, and population on a node has a bound, and reaching it makes callers wait or refuses them. Nothing grows without limit. Most bounds come from one place, the memory plan, which a node computes once at startup from its memory ceiling. This page lists the plan's figures, then every other bound with its flag and what happens at the limit. Backpressure explains why the bounds are arranged this way.

The memory plan

The node starts from its memory ceiling: --memory-ceiling, or three quarters of the container's memory limit. It takes away room for the garbage collector to grow the heap, half the ceiling at the default GOGC=100, then the fixed budgets: the write buffers, the caches, the queue window, and the process itself. The populations then share what is left, in order, each taking a share of what the one before it left:

  1. Held one-shot appends and queue sends take an eighth, at 24 KiB each, up to 8,192.
  2. Subscriptions take a quarter, at 28 KiB each, up to 16,384.
  3. Producer sessions take half, at 28 KiB each.
  4. The ingress budget for HTTP requests keeps the rest, and never less than its floor: 64 MiB, or four of the largest possible requests if that is more.

Each population gets at least 64, however small the node. The node logs the whole plan at startup. This is a node with a 6 GiB ceiling, an 8 GiB pod:

[INFO] novad: memory plan node_id=01a204ba-4d1b-719e-a6f2-418b9ac859f3 limit_bytes=0 ceiling_bytes=6442450944 gogc=100 gc_headroom_bytes=3221225472 admission_bytes=268435456 tail_cache_bytes=134217728 footer_cache_bytes=268435456 oneshots=8192 oneshot_cost_bytes=24576 oneshots_bytes=201326592 subscriptions=13019 subscription_cost_bytes=28672 subscriptions_bytes=373280768 sessions=19529 sessions_operator=0 session_cost_bytes=28672 sessions_bytes=559935488 queue_window_bytes=536870912 auth_cache_bytes=0 address_cache_bytes=16777216 connections_bytes=0 waiting_rooms_bytes=268435456 process_bytes=33554432 metadata_cache_bytes=0 ingress_bytes=559955968 ingress_floor_bytes=67108864 ingress_planned_bytes=559955968 overrun_bytes=0 maximal_request_bytes=7605616 override=false floored=false no_ceiling=false
Line8 GiB podWhat it is
ceiling_bytes6 GiBThe memory ceiling
gc_headroom_bytes3 GiBRoom for the heap to grow before a collection
admission_bytes, waiting_rooms_bytes256 MiB eachStandard's write buffer, and one-shots waiting for room in it
tail_cache_bytes128 MiBRecent records kept for reads from the leader
footer_cache_bytes256 MiBDecoded object footers, for cold reads
queue_window_bytes512 MiBQueue messages read ahead of delivery
address_cache_bytes, process_bytes16 MiB, 32 MiBThe address cache, and the process at rest
oneshots, subscriptions, sessions8,192, 13,019, 19,529The population caps
ingress_bytes534 MiBHTTP request bytes the node reads and decodes at once

The figures above come from a node with authentication off and the metadata store in memory. Other settings take their own lines first and leave the populations less:

LineCharged whenEffect
auth_cache_bytesThe node verifies tokens16 MiB; on an 8 GiB pod, 12,873 subscriptions and 19,309 sessions
connections_bytes--fleet-listen is set96 KiB for each connection the listener caps allow: 576 MiB at the defaults. Measured on an 8 GiB pod: 5,546 one-shots, 8,320 subscriptions, 12,480 sessions
metadata_cache_bytesThe node embeds oxiaOxia's cache
An Express classExpress buckets are setIts write buffer, waiting room, and fan-out buffer
Pod memoryCeilingOne-shotsSubscriptionsProducer sessionsIngress
4 GiB3 GiB4266406464 MiB, its floor
8 GiB6 GiB8,19213,01919,529534 MiB
16 GiB12 GiB8,19216,38474,0202,024 MiB

On a 16 GiB pod that verifies tokens, the sessions are 73,728. On a 4 GiB pod, the fixed budgets fill what the collector's room leaves, and the node warns at startup:

[WARN] novad: memory plan leaves the ingress budget only its floor, 13877248 bytes past the ceiling: the standing budgets fill what the GC headroom leaves of it, so lower them or raise the ceiling

Lower --footer-cache-mib, --tail-window-cache-mib, or the queue window, or give the node more memory. Three flags change the plan directly:

--memory-ceilingNOVAD_MEMORY_CEILINGDefault3/4 of the container's limit
The ceiling the plan starts from, in bytes. Without one and without a container limit, the plan is off: 4,096 producer sessions and a 1 GiB ingress budget.
--max-producer-sessionsNOVAD_MAX_PRODUCER_SESSIONSDefaultthe plan's
Lowers the producer session cap; it never raises it.
--ingress-budget-mibNOVAD_INGRESS_BUDGET_MIBDefaultthe plan's
Replaces the ingress budget. The plan still runs, and an override past the ceiling logs a warning naming the overrun. An override under the floor stops the node at start.

Populations and requests

BoundDefaultSet byAt the limit
Producer sessions per nodeThe plan's--max-producer-sessions lowers itResourceExhausted "producer sessions at the cap"; HTTP 429
Subscriptions per nodeThe plan's, at most 16,384The planResourceExhausted "subscriptions at the cap"
One-shot appends and queue sends held per nodeThe plan's, at most 8,192The planRefused before the body is read: ResourceExhausted "busy, retry", with when to retry; nothing was appended
HTTP request bytes read and decoded at onceThe plan's ingress budget--ingress-budget-mibThe request waits for room; one without its own deadline waits up to --ingress-max-wait (30 s)
An HTTP request body that stops sending10 s--ingress-progressThe body is cut off
Unacknowledged bytes in one session48 MiB Standard, 8 MiB Express--session-window-standard-mib, --session-window-express-mib; a producer can ask for lessThe producer waits; the node reads no further frames
Unacknowledged batches in one session1,024--session-max-batchesThe producer waits
One append batch1 MiB and 1,000 records--max-batch-bytes, --max-batch-recordsThe batch is refused whole, before it waits for anything
One record1 MiB--max-record-bytesThe batch is refused
One gRPC messageOne batch plus 1 MiB--max-batch-bytesResourceExhausted, unread
One read response8 MiB, 8,192 records--max-read-bytes, --max-read-recordsThe page returns short; one record is always served
Client connections, with a fleet listener4,096, and 512 from one address--max-client-connections, --max-client-connections-per-addressClosed at accept
Fleet connections2,048; 256 not yet showing a credential, 8 of those from one address--max-fleet-connections, --max-fleet-unproven-connections, --max-fleet-unproven-per-addressClosed at accept; past the unproven cap, one unproven connection is evicted
gRPC receive window per stream64 KiB--grpc-stream-window-kibThe sender waits on that stream
Placement capacity across the clusterEvery node saturated or drainingAdd nodesResourceExhausted; the SDK retries within its budget

Without a fleet listener, one listener serves everyone and the client connection caps are off.

To see how close a node runs to these bounds, compare nova_dataplane_sessions with nova_dataplane_sessions_limit, nova_ingress_reserved_bytes with nova_ingress_limit_bytes, and nova_listener_connections with nova_listener_limit. Refusals are counted in nova_dataplane_shed_total, nova_ingress_refused_total, and nova_listener_shed_total, each by reason.

Write, read, and cleanup budgets

BudgetFlagDefaultBoundsAt the limit
Standard write buffer--s3-memory-buffer-mib256 MiBAppend bytes from decode until acknowledgementAppends wait; the transport stops reading frames, so producers feel it through gRPC flow control
Standard backlog--s3-wal-backlog-flights1,024 flightsAcknowledged writes waiting to be indexed in metadataAppends wait; each stall is counted with its cause
Express WALFixed256 MiB pool; 1,024 flights or 4 GiB of backlogThe same, for ExpressAppends wait
Express fan-out buffer--s3-express-memory-buffer-mib32 MiBBytes the Express fan-out store buffersAdmission waits
Tail window cache--tail-window-cache-mib128 MiBRecent acknowledged records kept for reads, across classesThe oldest is evicted; a miss reads object storage
Footer cache--footer-cache-mib256 MiBDecoded object footersThe oldest is evicted; a miss fetches the footer again
Queue windowSet by the embedder512 MiB a node, 8 MiB a rangeQueue messages read ahead of deliveryRead-ahead waits
Auditor requests--auditor-s3-budget50 a secondObject-store requests per auditorJobs wait; the due age grows
Auditor rewrites--auditor-rewrite-mib64 MiB a secondBytes rewrites move through the nodeRewrites wait
Auditor deletes--auditor-delete-budget1,000 keys a secondDeletes per bucket, shared by every auditorDeletes wait
Auditor reads--auditor-read-budget, --auditor-read-concurrency10,000 a second; 64 openReads per bucket, shared; reads one auditor holds openReads wait
Auditor workers--auditor-workers2Concurrent cleanup jobsJobs queue
Fetch cache--auditor-fetch-cache-dir, --auditor-fetch-cache-mibOff; 40,960 MiB once a directory is setScratch disk for whole-object downloads during denormA read the cache cannot admit uses a ranged GET

Watch the write buffer in nova_direct_pending_bytes against nova_direct_pending_limit_bytes, and the backlog in nova_wal_backlog_flights and nova_wal_backlog_age_seconds. The auditor's limits leave work in its queues until there is room. Watch the queues' due age, nova_auditor_due_age_seconds, not their rates; see the auditor. The queue bounds an embedder sets, such as 512 work sessions a node and 1,024 unspent credits a session, are in Queue node bounds.

Read plans and the Gateway

BoundDefaultSet byAt the limit
A read plan's life: presigned URL expiry, and a raw fetch's5 minutesHalf of --auditor-read-grace (10 minutes)A plan never outlives the grace before an object is deleted
The Gateway's fetch bytes in flight64 MiBnovagateway --fetch-inflightResponses wait their turn
The Gateway's footer cache32 MiBnovagateway --footer-cache-bytesThe oldest entry is evicted
The Gateway's load on one cache instance1.25 times the meannovagateway --object-cache-load-factorA hot key spills to the next instance

Watch the Gateway's fetch budget in nova_gateway_fetch_inflight_bytes against nova_gateway_fetch_limit_bytes, and the time a fetch waits for it in nova_gateway_fetch_wait_seconds.

On this page