Server measurements
Every measurement of our own server: the soak test, where the CPU went, sockets, capacity, cost, transfer, bandwidth by room size and how long a new server takes.
Every measurement behind Servers and deploys, moved here from the devblog post Servers: sockets, pauses, capacity. Measured 16 and 17 Nov 2026.
Measured how: the soak test on a laptop at load about 28 (upper bounds); the room benchmark (scripts/bench/room-bench.ts) and the load test (scripts/bench/box-load.sh) on the box itself, a spare copy of the live build behind its own copy of the front, scripted players on the box, 3 minutes a step, windows with live players or a deploy thrown away (about half on 16 Nov). The CPU profile of the room process was taken on a shared Mac at load 11 to 55, so read its shares as a direction.
How a game gets to the box
- World picks a box by its health check (an answer at most 3 s old, 1.5 s to answer): fewest rooms, not full, not finishing its games, same protocol. The page gets a ticket signed with a shared key, good for a minute, and moves its socket there, only to an address on the site’s own domain.
- No box fits, or the socket closes before its first message: the game runs on Cloudflare, and the reason is logged. One game per account holds across both.
- Deploys: the new build starts on the box’s other port; the old process takes no new rooms, closes each between games, and exits within 45 minutes. Pages redial the same room and land on the new process with seat and team.
| Soak test: 32 people in 4 rooms | Ticks late p50 / p99 / max | Snapshot gaps p99 / max | Gaps over 50 ms |
| Box A, old process, finishing its games | 1.0 / 3.5 / 24.8 ms | 18.5 / 31.6 ms | 0 |
| Box A, new process | 0.9 / 4.3 / 27.6 ms | 19.2 / 32.1 ms | 0 |
| Box B | 0.8 / 2.4 / 22.1 ms | 18.2 / 37.0 ms | 0 |
| Local Cloudflare, 2 joins while A was silent | 4.8 / 17.7 / 39.1 ms | 23.2 / 44.4 ms | 0 |
A rolling deploy of A at 60 s (its 9 people rejoined on the new process), B stopped at 120 s (its 14 people rejoined on A), A’s health check silent for 10 s at 150 s (2 joins waited 1.5 s and played on Cloudflare). A single room through the ticket ran 1 ms behind real time at p99.
Sockets: where the CPU went
| Part of the room process (8 people, no bots) | Share |
| Socket sends (ws frames, Node streams, one writev a message) | 39% |
| Physics (Box2D WebAssembly about 5%, code around it about 4%, per-body hooks about 2%) | 12% |
| Input step | 8% |
| Socket reads and message handling | 7% |
| Garbage collection | 5% |
| Tile rules, timers, switches | about 4% |
| Ops metrics reading the CPU clock | 3% |
| Snapshot encoding and delta coding | 3% |
| JSON | under 0.1% |
The rest wasn’t broken down. With 7 Expert bots the bots are about 60% of a tick and nearly all of its 160 KB of garbage.
Each tick sends every player the players, the state, events and a snapshot of about 101 bytes: the cost was per message. The fixes: uWebSockets.js v20.71.0 (frames, sends and reads in C++, pinned Linux binaries checked by SHA-256, not an npm dependency at 103 MB; ROOM_WS=ws falls back), one write per player a tick (cork), the CPU clock read on one step in 4, and one movement-mods object per room. A socket over 1 MB behind is closed; ws would buffer without limit.
| Room benchmark on the box, CPU a room-tick | ws | uWebSockets.js | Collections a minute |
| One game, 8 people | 0.204 ms (1.22% of the core) | 0.137 ms (0.82%) | 22 / 14 |
| 1 person, 7 Expert bots | 0.368 ms (2.2%) | 0.252 ms (1.5%) | 60 / 36 |
| 24 games of 8 people | 0.152 ms (0.91% each) | 0.140 ms (0.84%) | 170 / 114 |
Build 356d8462, 30 s a scenario, both columns with one write a player a tick (cork alone on ws was not measured on the box). Memory 143 / 147, 211 / 220 and 244 / 258 MB. Every scenario’s hash of everything sent is the same on ws and uWebSockets.js and on the box and the Mac. On the Mac first (load 46 to 55): 0.239 ms on ws, 0.211 with cork, 0.183 on uWebSockets.js.
Capacity: the limit was pauses, not CPU
The strict bar, over 3 minutes: ticks late p99 under 4 ms and worst under 16, a room’s step the same, snapshot gaps over 50 ms under 1 a minute a player, round trip p99 within 5 ms of idle. All games on a box share one event loop, so one pause makes every game’s next tick late.
- First run (16 Nov, ws): 4 games of 4 v 4 passed; 6 and 8 got one tick 25 to 60 ms late; bot games never passed; Freeze tag held 8 at the line (missing by under 1 ms). At 8 games the box was 15 to 25% busy, players saw late ticks’ p99 at 2 to 3 ms and under 1 gap a minute.
- The pauses, from CPU profiles: the bots’ map data built in one step at a map change, 20 to 258 ms (248 to 258 when a bot took a leaver’s seat); waiting for the core while sending, 14 to 63 ms; garbage collection 5 to 32 ms; a game opening about 55 ms.
- The fix: the next map parsed during the end screen and its bots’ data built ahead in pieces of about 3 ms between ticks, with every byte sent and every final position hashing the same on and off.
| Second run (17 Nov, c81ea808) | Box busy | Longest pause | Ticks late p99 | At the bar |
| 4 games of 4 v 4 | 14% | 28.8 ms | 1.6 ms | no: one bot-data piece |
| 6 | 19% | 7.8 ms | 1.8 ms | yes |
| 8 | 23% | 14.3 ms | 1.9 ms | yes |
| 12 | 33% | 22.9 ms | 2.0 ms | no |
| 16 | 43% | 37 ms | 2.4 ms | no |
| 2 games, 1 person and 7 Expert bots | 9% | 15.8 ms | 1.6 ms | yes |
| 4 bot games | 12% | 10.8 ms | 1.9 ms | yes |
| 8 bot games | 17% | 32.4 ms | 2.0 ms | no: a collection |
One core, 180 s a step. Before the fix, on the same sockets, bot games failed on pauses of 145, 35 and 28 ms; after, the bots’ map data never took over 18 ms in a bot game. Each player got 11.5 to 12 KB/s on the wire.
Still failing: one bot-data piece of 14 to 29 ms (the last piece built the pad-shot table in one go; being fixed) and one 32 ms collection at 8 bot games. The box keeps its limit of 8 games.
The front’s share
Caddy does TLS for the secure WebSocket: 30 to 38% of the server’s CPU from 4 to 16 games. At 8 games straight to the process (no TLS), the box was 16% busy instead of 23%, pauses of 4 ms or more 13 instead of 32 in 3 minutes, the longest 10.7 instead of 14.3 ms, ticks late p99 the same 1.9 ms. A no-proxy path is being built.
Cost and transfer
- 8 games of 4 v 4 is 64 players at once: about $0.44 a player slot a month. A box of 8 bot games (one person each) is about $3.50 a player.
- A player gets about 6.6 KB/s of game data, 66 messages a second, and 11.5 to 12 KB/s on the wire in 64 TCP segments a second: each snapshot (50 to 150 bytes) is its own TLS record and segment, so headers are about 40% of the bytes (a 101-byte snapshot carries about 76).
- One always-full 4 v 4 game is about 238 GB a month (Freeze tag 179 GB, a bot game 29 GB); 8 always full come to about 1.9 to 2.0 TB against a 2 TB pooled allowance.
Bandwidth by room size
Measured how: scripts/wire-size.ts and scripts/bench/bandwidth-scale.mjs (docs/bench/bandwidth-scale.md). The real room and one real page on a virtual clock, the other people scripted; every message the room and the page send, with each transport’s headers added (WebSocket: TLS, TCP and IP, 74 bytes a write; WebTransport: QUIC as Chrome sent it, about 50 bytes a packet). Not load-dependent. A room is its people times a player. Bench numbers, 17 Nov 2026.
| People | WebSocket before | WebSocket now | WebTransport as first built | WebTransport now | A room now, WebSocket | GB a month, always full |
| 2 | 7.06 | 6.23 (12% less) | 6.38 | 5.28 (17% less) | 12.5 KB/s | 33 |
| 4 | 8.46 | 6.86 (19% less) | 8.68 | 6.24 (28% less) | 27.4 KB/s | 73 |
| 8 | 11.22 | 8.38 (25% less) | 12.91 | 8.36 (35% less) | 67.0 KB/s | 178 |
| 12 | 13.92 | 9.60 (31% less) | 17.28 | 10.21 (41% less) | 115 KB/s | 306 |
| 16 | 16.72 | 11.09 (34% less) | 21.55 | 12.30 (43% less) | 178 KB/s | 471 |
| 24 | 21.88 | 13.52 (38% less) | 30.13 | 15.98 (47% less) | 325 KB/s | 861 |
KB/s down a player on tp-gumbo, people changing keys every 0.3 to 0.8 s. "Before": the wire as it was on 16 Nov morning. "Now": PING_SLOW, STATS_DIFF and wire 5 on the WebSocket; on WebTransport also the age predictor and a bundle every second tick (redundant inputs and acked deltas both ways). GB a month: the room’s outgoing bytes, 30 days.
- Why the saving grows with the room: a snapshot is a fixed part plus a part per ball. Wire 4 spent about 12 bytes plus 10.6 a ball on the WebSocket; wire 5 about 16 plus 5.3. The headers (about 62 writes a second, 4.5 KB/s a player) don’t change with the room. At 2 people the headers are three quarters of the bytes; at 24 they are a third.
- A room grows with the square of its size: each of N players gets about 5.6 + 0.33 N KB/s now (5.8 + 0.68 N before). 24 people cost 26 times what 2 do.
- Up: 1.99 to 1.77 KB/s on the WebSocket at every size (nearly all TCP’s acks of the down segments); 6.0 to 3.1 on WebTransport.
- A quiet game (harbor, people still 60% of the time): a player gets within 5% of the busy game’s bytes on the WebSocket (WebTransport as first built, up to 14% less). The saving is about the same at 2 people and up to 7 points smaller at 24: wire 4 already spent less on a still ball (9.3 bytes a ball against 10.6), wire 5 spends the same 5.3.
- Spectators get what a player gets (8.48 against 8.38 KB/s now; 11.46 against 11.22 before), and adding them changes nothing for the players. 8 people and 16 spectators: 203 KB/s, 538 GB a month.
From live traffic
Every room counts what it sends and reads, by room size and transport, in its minute report; the Ops page has the hourly numbers with the build and wire switches each server ran. Game bytes only, no headers.
How long a new server takes
The three autoscaled servers made on 16 Nov 2026 at 21:35, from the relay’s log and each server’s boot log. From the create call to the rooms answering over TLS with the server’s own certificate:
| Region | Create to rooms answering |
| New York | 77 s |
| Amsterdam | 80 s |
| Sydney | 92 s |
- The provider’s boot was 41 to 48 s of each, our setup 24 to 32 s. The two don’t add up to the whole on every server; the gap (up to about 12 s on Sydney) isn’t broken down.
- Our setup: the server’s one-time hello to World (its boot token checked, its DNS name made, its key and settings answered), the rooms bundle (about 21 MB: the rooms, the WebAssembly physics and bots, the socket and WebTransport binaries, the setup scripts), then the fixed box’s setup: Node, Caddy, the rooms’ user and unit, the firewall, BBR and hardening (ssh keys only, updates, time sync, the per-address guard), the key into its settings, the bundle on each port, the rooms started, and Caddy’s certificate. Each step’s time: not measured yet.
- WebTransport was switched on by hand on those three later. New servers now switch it on in their first boot, and autoscaled regions now terminate TLS in the room process (no Caddy in front). Neither is timed yet.
Without the proxy
Until 17 Nov 2026 a proxy (Caddy) sat in front of each server’s games. Its jobs, and what does each now:
- Certificates: certbot, World answering the DNS check, renewed at 30 days left; under 7 the proxy comes back.
- One port for several processes: each has its own TLS port; the newest also listens on 443.
- Limits: per-address firewall limits and the process’s own guard.
| Games of 8 | Busy, proxy / direct | Proxy’s CPU share | Longest pause | Strict bar |
| 4 | 16% / 11% | 41% | 4.5 / 5.1 ms | yes / yes |
| 8 | 28% / 19% | 44% | 14.8 / 8.0 ms | yes / yes |
| 12 | 40% / 26% | 46% | 23.9 / 14.0 ms | no / yes |
| 16 | 52% / 34% | 47% | 22.3 / 16.8 ms | no / no |
New York, empty, 17 Nov 2026; bot games gain nothing. US West keeps the proxy: it also carries the autoscaler.
Measured on the New York server with nobody playing, the same spare process behind a test Caddy and then terminating TLS itself, every scripted player through TLS, 3 minutes a step (17 Nov 2026).
- Pauses of 4 ms or more in 3 minutes: 44 to 11 at 8 games, 271 to 40 at 12, 915 to 119 at 16. Behind the proxy the game process waited for the one core while the proxy ran.
- A connection: the TLS handshake 3.34 to 2.16 ms (median), the first byte after it 1.58 to 0.21 ms.
- TLS in the process costs it nothing extra: 10.2% of the core at 8 games against 10.8% behind the proxy, where it decoded the proxy’s frames instead.
- Bot games gain nothing: their cost is the bots’ thinking, and the proxy carried one socket a game (13 to 15% of the CPU). 8 bot games sit on the 16 ms line either way.
- Memory: the game process 5 to 17 MB more (its TLS state); the server 16 to 42 MB more free.
- WebTransport never went through the proxy. A server that had it kept a copy of the proxy’s certificate that nothing renewed once the proxy stopped (New York’s would have run out on 15 Feb); turning direct TLS on now drops that copy.
- The game limit: 12 people’s games pass the strict bar on one core without the proxy; the limit stays at 8 while bot games are common.
Tried and dropped
- A larger young generation (--max-semi-space-size=32): the same 34 to 40 minor collections a minute with bots.
- Skipping the plain map’s per-body physics hooks: about 2%, each guarded by state a powerup can change.
- Smaller snapshots: encoding is 3% of the CPU and halving a snapshot saves about 29% of the bytes, but rounding breaks prediction’s exact states and leaving out far balls hides what the page shows.
- SIMD in the physics WebAssembly: already on.
Also built
- The box’s limit: 10 rooms per core by default (a room measured 5 to 8% of a shared vCPU on the Mac, people sending about what bots thinking costs), 8 on this one-core box, and none while it is low on memory.
- One process per core (PROCS): each on its own port pair, the room limit split, new rooms to the process with the fewest connections. The box has one core, so PROCS is 1.
- BBR congestion control in setup for a box of its own; its effect on games is Not known.
- Hosting on a player’s computer: a group’s custom game with bots starts on the leader’s computer when its class is good (6+ cores, 8+ GB, desktop Chrome, Edge or Firefox, under 120 ms to our server, frames under 20 ms at p95), one click off; slow ones (a phone, 2 cores or fewer, 2 GB or less, a 2G connection, over 250 ms, frames over 34 ms) are never asked; under 6 cores, 8 GB, 3G, over 120 ms, Auto quality stepped down in the last 14 days or frames over 20 ms shows the choice off. The frame time is the lower middle of the last 5 games. Five seconds under 30 fps or 45 ticks a second steps the class down for the next game.
Not measured
The round trip (the scripted players share the core), more than one core, real networks, and the Rust prototype on the box: its build failed because the box’s newer C library header breaks under the build’s renames of three maths functions.
Why competitive games run on Dedicated servers
Measured 16 Nov 2026.
- The path. From a US West home network a traceroute reaches Cloudflare's Los Angeles site in about 6 ms every time. Yet Cloudflare's trace page reports the request handled at Dublin, Tokyo or Vienna on many connections (5 of 8 in one sample, 10 of 12 in another) while the site it entered stays Los Angeles: Los Angeles accepts the connection, and Cloudflare hands it to a far data centre to process. Round trips: 9 to 44 ms handled at Los Angeles, 263 to 334 ms far, once 700. It varies per connection and by time of day.
- Why, not measured. The usual explanation is free-plan traffic being moved when a location is short of capacity. We haven't measured the cause.
- Plans. Workers Paid ($5 a month) buys compute; the domain's plan (Free or Pro) governs edge routing. Pro prioritises routing but promises no location. Not tried.
- Mid-game. A live socket's path doesn't change, so a ping that jumps mid-game is most likely the seat hold's silent redial being handed somewhere else. Not yet checked against the reconnect counts.
- Sharing. On Workers, on any plan, a room's clock pauses 40 to 200 ms a few times a quarter hour with no bots. A 4 v 4 with 7 bots on Cloud had 2.1 clock hitches over 40 ms and 6.8 snapshot gaps over 50 ms a minute, against 0 and 0.5 on the Dedicated server. Objects of one script can share a thread: the daily map's check once froze every room beside it for seconds.
- The Dedicated server. Its address is DNS-only, so the game socket never enters Cloudflare's edge: ICMP 4.7 ms, the browser's readout 6 ms against 53 on Cloud in the same minute, key press to snapshot 3 to 5 ms against about 35. Its tick is never more than 1 ms behind, one bot game takes about 3% of its one core, and CPU steal was about 0.002% over 13 days. It's a shared virtual core; dedicated-CPU plans exist and aren't needed on these numbers.
- What each is for. Dedicated: competitive and ranked games in a region that has one. Cloud: every other region, social rooms, lobbies, overflow and the site.
- Since then. Four Workers since 17 Nov 2026. A site deploy restarts no game. Autoscaling Dedicated servers: on since 16 Nov 2026, with servers up in US East, Europe and Oceania (switch AUTOSCALE_LIVE). World makes a server through the provider's API when a region's servers fill, Cloud covers the gap while it boots, and idle servers are removed, all under a monthly spend cap. The provider has no built-in autoscaling for plain servers.
More: Ping spikes from Cloudflare routing.