Autoscale a cluster

Autoscale a cluster

Let the operator size the Nova pods, the auditor pool and the metadata store from their load.

The operator can size three parts of a cluster from what they report. It sizes the Nova pods by how busy they are, the auditor pool by the age of its backlog, and the metadata store by how hot its shards run. The first two loops are off until their autoscale block is set. The metadata store's shards split whenever oxia runs as a cluster, and its autoscale block lets the operator add servers. Each loop changes one thing at a time.

Clients notice growth only as more capacity. A shrink drains one node, so the producers it served reconnect once to another node. Autoscaling needs the default External placement of the metadata store; under Embedded the operator refuses it.

Turn it on

Set the bounds

values.yaml
constellation:
  spec:
    serving:
      replicas: 3
      autoscale: { min: 3, max: 5 }
helm upgrade nova deploy/helm/nova --namespace nova --values values.yaml

replicas is now only the size before the first decision. min is also the floor no shrink goes below.

Watch the decisions

The operator writes each decision to the Constellation's status:

kubectl -n nova get constellation nova \
  -o jsonpath='desired={.status.desiredStars} lowLoadSince={.status.lowLoadSince}'
desired=3 lowLoadSince=2026-11-22T18:43:18Z

desiredStars is the size the fleet moves to. lowLoadSince marks when the whole fleet first read below the low-water mark; it clears as soon as one node reads above it.

Nova pods

Every 30 seconds the operator reads one node's view of the cluster. It decides only when the fleet is steady: every pod ready and no node leaving. So a decision waits until the nodes added by the last one have started.

RuleDefaultWhat happens
Grow to fit the loadTarget 60%desired = ceil(nodes × average use ÷ target)
Grow at onceAny stranded nodeAt least one node more, without waiting for the average
ShrinkEvery node below 30% for 30 minutesOne node fewer, removed with a drain and a decommission
Boundsmin, maxEvery decision stays within them

A node's use is the highest of four measures: its CPU, network and memory use, each measured against its slice, and its backlog of writes waiting for object storage. The 60% target sits well below 85%, the use at which Nova starts moving streams off a busy node. The gap absorbs spikes, so in a well-sized fleet streams rarely move.

A node is stranded when it is busy and no other node can take a stream from it. Waiting for the average would leave its streams slow, so one node is added at once.

Each targetPercent, lowWaterPercent and scaleDownAfter can be set in the same block. A shorter scaleDownAfter saves machines sooner and drains nodes more often.

Auditor pool

With audit.autoscale set, the operator looks at the age of the oldest due work, then at how busy the auditors are:

Due workAuditorsDecision
Older than 5 minutesAt or above 50% busyOne auditor more: the pool is short of capacity
Older than 5 minutesBelow 50% busyNo change, and AuditWedged turns true
FreshBelow 30% for 30 minutesOne auditor fewer

Old work with idle auditors means a job or a backend is stuck, and more auditors would cost money and fix nothing. The operator freezes the pool and says so instead; see Auditor delays. The thresholds are ageThreshold, busyPercent, lowWaterPercent and scaleDownAfter.

Auditors carry no identity. A stopping auditor finishes its jobs and gives up its share of the work, and the others take it over.

Metadata store

With metadataStore.oxia.servers above zero, the operator splits hot metadata shards. With metadataStore.oxia.autoscale set as well, it adds servers to carry them:

  1. Every node and auditor reports its metadata operations over 4,096 slices of the key space. The operator adds them up per shard.
  2. When the hottest shard stays above 60% of opsPerShard (2,000 operations a second by default) for 10 minutes, the operator splits it where half its load falls on each side.
  3. If one slice carries more than half of a shard's load, a split at the middle cannot help. The operator gives that slice a shard of its own instead. If that shard is still too hot, MetadataHotStream turns true: one stream's metadata is more than a shard can serve.
  4. Under autoscale, servers follow shards: ceil(shards ÷ leadersPerServer), between servers and maxServers, with 7 shard leaders per server by default. Without it, the server count stays at servers.

The operator also splits the widest shard, at its middle and without waiting, when the cluster leads more than streamsPerShard streams (10,000) for each shard. Shards stop splitting at leadersPerServer × maxServers, or leadersPerServer × servers without autoscale; past that, heat raises MetastoreDegraded instead. Splits are permanent and the server count only grows, because removing a server moves data. Shrink it with a deliberate spec change. The p99 latency watch only raises MetastoreDegraded after 5 minutes above 50 ms, and never scales anything.

Watch progress

WhatWhere to look
The fleet's target sizestatus.desiredStars
The auditor pool's target sizestatus.desiredAuditors
The metadata store's server countstatus.desiredOxiaServers
A shard about to splitstatus.hotShard and status.shardHotSince
A node leavingphase in status.stars and the DepartureHeld condition

See also

On this page