Size the cluster

Size the cluster

Choose how much network, CPU, memory and disk each Nova pod reserves, and how many fit on a machine.

Each Nova pod declares a slice: its share of a machine's network, CPU, memory and, for an auditor, disk. Kubernetes places pods by CPU and memory but knows nothing of network bandwidth, and network is what a Nova node runs out of first. The slice makes the network share explicit, so pods fit on machines without starving each other, and so each node knows how busy it is.

What a slice sets

The operator turns a slice into the pod's resources, the --net-capacity flag, and the node's connection caps:

kubectl -n nova get pod nova-0 -o jsonpath='{.spec.containers[0].resources}'
{
  "limits": {
    "memory": "1Gi"
  },
  "requests": {
    "cpu": "100m",
    "memory": "256Mi"
  }
}

That pod ran with slice: { netCapacity: 100M, cpu: 100m, memory: { request: 256Mi, limit: 1Gi } }, and its arguments carry --net-capacity=100000000.

Slice fieldBecomesEffect
netCapacity--net-capacity, in bytes a secondThe network share the node measures its use against
cpuThe CPU request, with no limitSpare CPU on the machine stays usable
memory.requestThe memory requestHow pods pack onto machines
memory.limitThe memory limitThe node's memory budget, three quarters of it, and its connection caps
scratchAn ephemeral-storage request and a volume of that sizeThe auditor's disk

Requests equal the slice, so how many pods fit on a machine follows from Kubernetes' own arithmetic. A spread rule on the hostname, at most one pod's difference between machines, keeps the count even without forbidding two pods on one machine.

netCapacity counts bytes on the wire. An append crosses the network to the node and again to object storage, a read crosses it on the way out, and Express writes a copy to each zone's bucket. In measurements the wire carried 2 to 3 times the bytes clients sent.

The reference slices

A slice left out takes these figures. The code calls them provisional until a calibration campaign replaces them.

PodNetworkCPUMemoryDisk
Nova node750M (about 6 Gbps)24Gi request, 8Gi limitNone
Auditor438M (about 3.5 Gbps)48Gi request, 12Gi limit300Gi scratch
oxia serverNone4500m4Gi, request equal to limit10Gi data, 8Gi WAL
oxia coordinatorNone500m256Mi, request equal to limitNone
Object cacheNone22Gi request, 4Gi limit300Gi scratch
GatewayNone11Gi, request equal to limitNone

The node's figure comes from one process's measured comfort point: about 256 MiB/s of client bytes, under one core, and a 2.2 GiB working set. On a c8gn.4xlarge, with 50 Gbps of guaranteed network, 16 CPUs and 32 GiB, seven node slices fit: min(50 / 6, 15.5 / 2, 30 / 4) = 7. CPU and memory bind just before the network does, which leaves the network a margin. Smaller sizes of that family only burst to their rated network, so they are a trap for a steady load. Within one family the price per Gbps is flat, so choose the machine size by how many nodes you accept losing together.

Choose a slice

Start from the reference slice and change it when measurements say so:

SignWhat to change
Network use reads high while the machine's network has roomSet netCapacity to the machine's guaranteed network divided by the nodes it carries
Pods are killed for memoryRaise memory.limit; the node keeps its retained memory under three quarters of it, and the rest is room for the Go runtime
Machines run half emptyLower the slice, or pick a smaller machine of the same family that still guarantees its network

The autoscaler aims at 60% use of the slice, so a slice that is too generous makes the fleet too small, and one that is too tight makes it too large.

Auditor scratch

An auditor copies records out of the shared WAL objects into per-stream objects. It reads each WAL object whole into its scratch disk, straight from object storage, then works from there. The scratch needs to hold about the ingest rate times the linger before that copy, shared across the pool. The in-process budget is 90% of the volume, so the auditor slows down before Kubernetes would evict it for disk.

A slice with less than 50Gi of scratch, zero included, renders no auditor:

spec.audit.slice.scratch is 10Gi, under the 50Gi floor: auditors denorm whole WAL objects into their scratch, and without it they read every slice with its own GET and fall behind ingest; no auditor runs until the slice has at least 50Gi

No auditor means no reclamation

While the scratch is under the floor, the Nova pods still run with --audit=off. Nothing reclaims storage until the slice has 50Gi or more, or audit is removed.

The metadata store

oxia's servers run with requests equal to limits, so their CPU and memory are always theirs. Every metadata commit is a quorum write through them. Each clustered server gives a third of its memory to its database block cache: 1,365 MiB at the reference 4Gi. Every metadata write reads the record it replaces, so a cache too small for the shards' data makes each write slower to apply. databaseCache sets the size instead, at least 64Mi and at most half the memory:

The Constellation "bad" is invalid: spec.metadataStore.oxia: Invalid value: "object": databaseCache is at most half the servers' memory pin (resources.memory, 4Gi when unset): the cache is reserved inside it

Raise resources.memory with the cache, since the cache is reserved inside it.

On machines

Without Kubernetes there is no slice, and a node measures its use against its flags. --net-capacity is off by default, so set it to the machine's guaranteed network in bytes a second. --memory-ceiling defaults to three quarters of the cgroup memory limit, and turns the memory measure off on a machine without one. See the novad reference.

See also

On this page