Scaling and sizing#
This page covers how many replicas to run, how to size their pods, how autoscaling behaves and the per-replica limits clients can reach. It assumes a deployment installed as in Deployment; size the backing store separately (Backing store).
Replica model#
Every replica serves every request, so clients need no session affinity.
Long-lived streams (JoinSession and SubscribeReadLayer) stay on the replica that accepted them.
A new replica serves only the joins that arrive after it is ready; it takes no streams or queued joins from busy replicas.
When a replica shuts down, its clients reconnect to the others, spread over up to 20 seconds.
The unit of load is a subscription: one client with one layer open. A user with ten layers open holds ten. When a client joins a layer, the replica first sends it the layer’s current state (a catch-up), which is where most of a join’s CPU and memory goes.
Starting size#
Start from the chart defaults and adjust from what you measure under representative load.
Setting |
Chart default |
Adjust when |
|---|---|---|
Replicas |
3 to 10 ( |
The defaults serve up to about 33,000 subscriptions; see the 10-replica rule below |
CPU |
request |
Replicas run at the CPU limit during join bursts at |
Memory |
request |
See below |
Subscriptions per replica |
4,096 at the |
Follows the memory limit; see below |
Catch-ups at once per replica |
8 ( |
You change the CPU limit: keep about 4 per CPU |
As a guide, a default replica catches up on the order of 30 to 50 joins per second on layers of up to about 7,000 prims.
The memory request defaults to 70% of the limit, and follows it.
The memory limit is required and sizes the replica: you change these amounts only by changing resources.limits.memory:
|
Subscriptions per replica |
Memory for catching up large layers |
Upload memory |
|---|---|---|---|
|
3,276 |
433 MiB |
307 MiB |
|
4,096 |
744 MiB |
384 MiB |
|
6,553 |
1,607 MiB |
614 MiB |
A larger limit never gives less of any of these amounts, so you can size the limit to any value at or above the minimum below.
The startup line pod memory budgets derived from the pod memory limit and the gauges in Is it saturated? show the limit read and the amounts in force.
At the chart’s other defaults the smallest limit that starts is 2687Mi on any CPU count without a backup store, and 3282Mi on any CPU count with one (Enable checkpoints).
Raising a connection pool (valkey.poolSize, valkey.subscriberPoolSize, valkey.maintenancePoolSize or valkey.snapshotPoolSize), valkey.subscriberMaxConcurrentCatchups, valkey.catchupFencedReadConcurrency, layer.uploadAdmissionMaxWaiters, layer.maxSize or valkey.snapshotAtomicReadMaxBytes raises that minimum, and takes memory from catching up large layers.
A pod below the minimum for its settings exits at startup with configuration error: naming the smallest limit it needs, and during an upgrade the old pods keep serving.
A helm upgrade that changes the limit rolls the pods; resizing a running pod’s memory in place, on Kubernetes 1.27 and later, restarts its container.
Autoscaling#
autoscaling.mode chooses what sets the replica count:
scaler(default): a small scaler pod adds replicas for CPU at 80% of the CPU request, for joins waiting more than about 10 seconds to start their catch-up, and for subscriptions above 80% of the ceiling.hpa: a HorizontalPodAutoscaler on CPU utilization, optionally memory (autoscaling.targetMemoryUtilizationPercentage). It cannot see waiting joins or subscriptions, so a join burst can wait at the minimum replica count.
Choose scaler unless the identity that installs the chart cannot create Roles and RoleBindings in the namespace.
In that case, set autoscaling.scaler.rbac.create: false and grant the scaler’s ServiceAccount the same rules yourself, or use hpa.
In hpa mode every container in the server pod needs a CPU request (and a memory request if you enable the memory target), injected sidecars included; the chart refuses to render if the token sidecar’s requests are removed or zero.
What to expect in both modes:
Scale-up is immediate.
Scale-down waits for 10 minutes of lower demand, then removes one pod per minute; each removal reconnects that pod’s clients.
In
scalermode, scale-down also waits while a rollout runs or any pod is unready.In
scalermode, the replica count stays where it is while the service is held for disaster recovery (Held for disaster recovery). After the hold clears, scale-down waits a full window (10 minutes by default), so the fleet does not shrink while every client reconnects.A fresh install starts at one replica until the autoscaler raises it to
minReplicas.If the scaler stops, the replica count stays where it is; alert on it (Monitoring).
The scaler pod uses the server’s nodeSelector and tolerations but not its affinity; set autoscaling.scaler.affinity if it needs one.
If you write your own network policies, let the scaler pod reach port 9090 on the server pods.
In hpa mode, set autoscaling.behavior: null to restore the Kubernetes scale-down defaults; {} keeps the chart’s damping.
For a fixed replica count, set autoscaling.enabled: false and replicaCount, and keep podDisruptionBudget.minAvailable below that count.
Keep fleet-wide layer reads at 10 or fewer#
Keep autoscaling.maxReplicas × valkey.catchupSnapshotReadConcurrency at or below 10, and the same for valkey.catchupFencedReadConcurrency.
Both settings default to 1, so the defaults support up to 10 replicas.
Above 10, a join wave across the whole fleet can slow edits for every user on the store.
So one deployment serves up to about 33,000 subscriptions; for more, run another deployment with its own backing store.
The scaler logs a warning when autoscaling.maxReplicas × valkey.catchupSnapshotReadConcurrency exceeds 10.
Subscriber capacity#
Each replica has two limits clients can reach:
Subscription ceiling, which follows
resources.limits.memory(4,096 at the default5Gi; Starting size). A subscribe past it waits up tovalkey.subscriberAdmissionWaitMs(default 20 seconds), then fails with a retryableUNAVAILABLE.Catch-ups at once (
valkey.subscriberMaxConcurrentCatchups, default 8). Later joins wait their turn with the stream open and nothing delivered yet.
On a clustered backing store, valkey.subscriberPoolSize (default 256) also caps how many distinct layers one replica serves at once (Backing store connections).
Watch live_edit_subscriber_admitted per replica against live_edit_subscriber_max_subscriptions, sustained live_edit_subscribe_catchups_waiting, and the refusal counters in Capacity and saturation.
When replicas stay near either limit, raise autoscaling.minReplicas, or autoscaling.maxReplicas within the rule above.
New replicas relieve only later joins, so set autoscaling.minReplicas for the join bursts you expect at once.
Rollout headroom#
A rollout runs up to a third more pods (What to expect during a rollout); leave room for them in node capacity and ResourceQuota.
Until old pods finish shutting down, up to twice the replica count holds backing-store connections, so the store must accept connections for twice autoscaling.maxReplicas replicas (Backing store connections).
Limitations#
Structural edits to very large layers. Creating, deleting, moving or reordering prims in a layer of more than roughly 35,000 placed assets can fail with
DEADLINE_EXCEEDED, with nothing applied, while others edit the same layer. A placed asset here is a prim with a reference and four attributes. With no concurrent edits, the failures start at roughly 69,000 placed assets. Stores with higher network latency, such as managed services, and prims with more attributes reach it at smaller sizes. Split very large scenes across several layers.Deleting and replacing many layers at once. Each replica cleans up deleted and replaced layers a few at a time, fewer for layers holding thousands of large values; a larger
resources.limits.memoryallows more at once. A delete can wait behind earlier clean-ups for seconds. ADeleteLayerstill waiting at its deadline failsDEADLINE_EXCEEDEDwith nothing changed, and aDeleteSessioncan stop partway the same way; clients retry them as the Live Edit client API guide’s Status codes describes. Watchlive_edit_retirement_wait_seconds; if clean-ups wait for seconds, raise the memory limit.Replicas per deployment. See the 10-replica rule.
All scaling and capacity settings: Autoscaling settings and Capacity settings.
See next#
Monitoring: health, metrics and alerts.