We proved our self-hosted LiveKit fleet scales linearly: 6 concurrent live events of 20 publishers and 10 viewers, placed by the production orchestrator, grew the fleet from 1 to 4 VMs and back. Each loaded node carried exactly 2 events at 34-44% CPU and 283 Mbps out. Scale-up took about 100 seconds; the test cost USD 0.60.

The platform is a multicam live-event streaming product. Every event is one LiveKit room in which about 20 phones publish and 10 viewers subscribe to everything. The client wanted proof that adding events adds nodes and nothing else degrades.

This post covers the fleet result. The single-node capacity numbers, and the load-test traps that make them hard to get, are in lk load-test lies to you at 40 publishers: the 5x5 layout cap and generator saturation that invalidate LiveKit benchmarks.

What did we test, and how?

We created 6 events through the production API, so the app's own placement logic chose each event's node, as it does for real users. Each room ran 20 VP8 640x360 publishers without simulcast and 10 full-grid subscribers, driven by lk load-test from two throwaway 4 vCPU generator VMs. We added the events in pairs.

Media nodes are g6-standard-2 Linodes (2 vCPU, 4 GB) running livekit-server 1.13.11, all in one region. They run only LiveKit. A separate app VPS hosts the control plane, the orchestrator, and an nginx proxy for signalling. Media flows over UDP directly between clients and the node.

We waited for each pair's new warm node to turn healthy before adding the next pair. That isolates each stage, so the numbers describe steady state rather than a herd of events arriving faster than nodes can boot.

Per-node CPU is mpstat busy% averaged over 60 seconds after ramp-up. Bandwidth comes from /proc/net/dev deltas on the public interface.

The runner was a small shell wrapper. It logs in to the app, creates an event, reads the livekit_url that the join endpoint returns (which encodes the chosen node), and starts the room on a generator:

# per event: create via the real API so pick_node() decides placement
ID=$(curl -s -b $COOKIES -H 'Content-Type: application/json' \
  -d '{"name":"fleetproof-'$N'"}' https://app.example.com/api/events | jq -r .id)
URL=$(curl -s -b $COOKIES -H 'Content-Type: application/json' \
  -d '{"role":"viewer"}' https://app.example.com/api/events/$ID/join | jq -r .livekit_url)
# URL is wss://media.example.com/n/<node-label> -- the placement decision, visible

ssh $GEN "LIVEKIT_API_KEY=$LIVEKIT_API_KEY LIVEKIT_API_SECRET=$LIVEKIT_API_SECRET \
  nohup lk load-test --url $URL --room $ID \
    --video-publishers 20 --subscribers 10 \
    --video-resolution medium --video-codec vp8 --no-simulcast \
    --layout 5x5 --num-per-second 2 --duration 40m > /tmp/fp-$N.log 2>&1 &"

What did the 1-to-4-node fleet numbers look like in 2026?

Every loaded node carried exactly 2 events, about 29 Mbps in and 283 Mbps out. Per-node CPU stayed flat as the fleet grew: 44% on the original node and 34-35% on each autoscaled node. All 6 rooms delivered 200/200 tracks with zero connection errors. Total fleet egress at 6 events was about 850 Mbps.

StageEventsPlacementLoaded nodesNodes running (incl. warm spare)Per loaded node: CPU / net in-outResult
12E1, E2 on node 11244.2% / 29-283 Mbps (817 MB used)clean
24E3, E4 on node 223node 1 44.0%, node 2 34.6% / 29-283 Mbps eachclean
36E5, E6 on node 334node 1 44.2%, node 2 35.5%, node 3 33.5% / 28-283 Mbps eachclean

Here, "linear" has a specific meaning. Adding events added nodes, and the existing nodes didn't notice: node 1 stayed at 44.0-44.2% CPU through all three stages. No room shared a node with more than one other room. The control plane only ever carries signalling, so it never sees media bandwidth.

We have not isolated why the original node runs about 10 points hotter than the clones. It was configured by hand before the provisioning script existed, so the clones are not byte-identical to it. All three nodes were within the 2-slot budget we had measured in the single-node tests, so the gap didn't change any decision. We note it rather than explain it away.

Why scale on free slots instead of CPU or a forecast?

Events on this platform are created on a whim, so there is nothing to forecast. A LiveKit room can't be split across nodes, which makes a node's useful capacity a whole number of events, not a CPU percentage. So we scale on slots. Each node has 2, and whenever fleet-wide free slots drop below 1, the orchestrator boots another node.

The single-node constraint comes from LiveKit itself. Its distributed deployment docs state that "a room must fit on a single node". A node at 45% CPU with one free slot can take an event. A node at 30% CPU with no free slots can't, because the next event needs headroom for 30 more participants, not a few more percent.

The rule is "free slots ≥ 1", which means N loaded nodes always run N+1 nodes. A new event therefore lands in a slot that is already warm, while the next node boots behind it. This is the slot math from the orchestrator's planning function, trimmed to the scale-up path:

cap = cfg.slots_per_node                       # 2, measured, not estimated

def slot_busy(node):
    # rooms with >=1 participant; unknown (rooms API failed) counts as FULL
    return cap if node["busy"] is None else min(node["busy"], cap)

# draining nodes take no new events, so they contribute no free slots
free = sum(cap - slot_busy(n) for n in healthy if not draining(n))
# nodes still booting (inside boot grace) count as future capacity,
# otherwise every 30 s tick during a boot would create another node
effective_free = free + len(pending) * cap

if effective_free < cfg.min_free_slots:        # 1
    want = ceil((cfg.min_free_slots - effective_free) / cap)
    create = max(0, min(want, cfg.max_nodes - total_nodes))   # cap at 6

Two details carry most of the weight. First, unknown load counts as full: when the rooms API on a node fails, we would rather boot a spare we don't need than place an event on a node we can't see into. Second, pending nodes count toward free capacity. Without that, the 30-second loop would create a new node on every tick during the ~100-second boot.

We considered a CPU threshold as the primary trigger and ruled it out. CPU lags participant joins by the ramp-up time, which was 15-25 seconds in our runs. It also says nothing about whether the next 30-participant event fits. The warm spare costs one idle shared 4 GB node, $0.036 an hour, and that is the whole price of every event starting instantly.

How does the app pick a node for a new event?

The app reads a fleet snapshot that the orchestrator writes every tick. It picks the healthy, non-draining node with the most free slots, breaking ties by fewest busy rooms and then by label. Events assigned since the last snapshot count as busy. If every slot is taken, the app still assigns the least-busy node and never blocks event creation.

def pick_node(fleet, assigned_since_snapshot):
    cap = fleet["slots_per_node"]
    cands = []
    for n in fleet["nodes"]:
        if not n["healthy"] or n["draining"] or n["status"] != "running":
            continue
        busy = n["busy"] + assigned_since_snapshot.get(n["label"], 0)
        cands.append((cap - busy, busy, n["label"]))
    if not cands:
        return None
    cands.sort(key=lambda c: (-c[0], c[1], c[2]))   # most free, least busy, label
    return cands[0][2]   # even at 0 free: degrade, don't block; a node is booting

The assigned_since_snapshot term closes a real race. An event created between two orchestrator ticks has no participants yet, so its room is invisible to the snapshot. Without that correction, two events created seconds apart would both see the same free slot and pile onto one node.

Routing is one nginx map that the orchestrator rewrites. Clients connect to wss://media.example.com/n/<label>, and nginx proxies the WebSocket to that node's port 7880. The orchestrator runs nginx -t before every reload and rolls the file back if the test fails:

map $media_node $media_backend {
    default "";
    media-node-a 203.0.113.21:7880;
    media-node-b 203.0.113.22:7880;
}
# location ~ ^/n/(?<media_node>[a-z0-9-]+)(?<rest>/.*)?$ -> proxy_pass http://$media_backend$rest
# unknown label => empty backend => 502, never a wrong node

Throughout the proof, placement went to the node with the most free slots every time, and no event landed on a full node. Each pair of events filled the newest warm node, which triggered exactly one more boot.

How long does a new LiveKit media node take to come up?

Each scale-up ran from the orchestrator's scale_up decision to "node healthy and in the nginx map", and the three took 118 s, 118 s and 88 s. That averages about 100 seconds, from a stock Ubuntu image plus a first-boot provisioning script. The decision itself can trail the room going busy by up to one 30-second tick.

On an earlier orchestrator run we split the boot time. About 77 seconds passed before the provider reported the instance as running, and LiveKit answered its health check about 21 seconds after that.

Our provisioning script is a Linode StackScript. It sets the firewall, installs a pinned livekit-server release, writes livekit.yaml with the fleet-wide key pair, and enables the service. Most of the wait is the provider, not our script.

The worst case to reason about is roughly 30 s of tick delay plus about 120 s of boot, so about 2.5 minutes from "last free slot taken" to "new slot ready". Without a warm spare, an event created in that window would leave 20 phones staring at a spinner.

With the warm-slot rule, the window is only a risk if two new events arrive inside the same 2.5 minutes while the fleet has exactly 1 free slot. At this platform's event rate we accept that risk. Two spare slots would remove it, at twice the idle cost.

How did the fleet scale back down, and what did the reaper get wrong?

The load stopped at 10:02. Fifteen minutes later the orchestrator began draining idle nodes, and it deleted them one per tick at 10:17:23, 10:18:23 and 10:18:53, taking the fleet from 4 nodes to 1. The reap worked as designed. The design had a hole, though: the node it kept was not the one we wanted to keep.

Scale-down is two-phase. A node idle for 15 minutes is first marked draining, which removes it from placement and from the free-slot count. If it is still idle on the next tick, it is deleted.

The drain tick protects the window between "event assigned" and "first participant joins", when the room doesn't exist yet. A node that receives a room while draining is un-drained. The orchestrator never reaps below a 1-node floor, never in a tick that scaled up, and never if the deletion would drop free slots below 1.

The hole was selection. The reaper ranked idle nodes by idle time only, with no preference for age. So it deleted the original hand-built node, which held the TURN domain and certificate for venues that block UDP, and kept an autoscaled clone as the floor.

Nothing broke during the test, but the next real event at a hostile venue would have lost its fallback path. We rebuilt the floor node and added TURN-over-TLS to it by hand.

The fix was a pin tag. A node tagged pinned is never marked draining, never scale-down deleted, and never reaped as dead. It still counts as capacity and free slots like any other node. We chose the tag over an "oldest node wins" rule because the floor's special status is a property we assign on purpose, not something it happens to have by being old.

The first attempt at this proof failed for an unrelated reason. Fleet nodes had a narrower UDP port range than the original node, and 60 participants per node exhausted it.

That story, and how to tell port exhaustion apart from a real capacity limit, is in the lk load-test post. We deleted those nodes, fixed the provisioning script, and reran everything. All the numbers above come from the clean rerun.

What did the fleet proof cost, and what didn't it cover?

The whole proof cost about USD 0.60. Two 4 vCPU generator VMs ran for about half an hour (roughly $0.29). Media nodes added up to about 6 node-hours at $0.036 (roughly $0.22), including the aborted first attempt. About 35 GB of transfer stayed inside the pooled allowance, and the generators were deleted when the run ended.

Making the test infrastructure disposable is what makes a proof this cheap. We create it with the same API calls production uses and delete it in the same session, the pattern we used when we built an on-demand proxy fleet to collect 1.1M records.

It's also why we didn't extrapolate fleet behaviour from the single-node numbers. Measuring it cost less than a coffee.

The proof does not cover real phones on real networks, TURN-relayed participants, simulcast viewers, or stages longer than about 3 minutes. It also didn't test bursts of events arriving faster than one boot cycle, because we added pairs only after each warm node was healthy. We told the client all of that alongside the table, and each of those is its own test.

What does the fleet proof let you promise a client?

It lets you put three numbers in writing: 2 events per node, about 283 Mbps out per loaded node, and about 100 seconds to add capacity, with existing nodes unaffected as the fleet grows. The free-slots-≥-1 rule turns that into instant starts for unscheduled events, at the cost of one idle VM.

Scale-down returns the fleet to its pinned floor about 15 minutes after the last event ends. All of it was verified for USD 0.60, and the one defect we found was the reaper's choice of node, not capacity.