System Design Atlas

Real-time multiplayer world

08 / 10Worked example

Investigating bottlenecks

Which measurement justifies limiting the transmitted area of interest?

The failure sequence shows where load and retries interact. The diagnostic plan treats measured waiting time, processing duration and business conflicts separately.

Starting point After a restart, load the durable record before awarding again.

Assumptions for the example case

A fictional example design: one session with at most 32 players, server-authoritative movement, one-time pickup of world items, reconnection within the same session and durably confirmed rewards. Figures and quality goals are illustrative test assumptions. A shared global game world, player trading, paid items and comprehensive fraud detection are outside the scope.

Diagnose the limiting resource

Measure tick budget separately from item contention

Tick delay64,000 inputs/s
Queue age + tick durationMeasure
Allocation conflictP-21 against P-22
Input order + distancecheck

A backlog indicates technical overload; already allocated is the correct result of server-side ordering.

Many distant characters enlarge each state snapshot. Measure visibility range and snapshot rate, then transmit only relevant characters. 640 KiB/s is a separate assumption before overhead and must be verified on the transport.

From signal to action

SignalValidationReaction
Limit snapshot trafficMany distant characters enlarge each state snapshot.Measure visibility range and snapshot rate, then transmit only relevant characters.
Conflicts on the shared entityP-21 and P-22 send valid pickup commands for G-21 in the same tick. Test both server-side input orders: the first valid command in that order wins; the other receives already allocated. Exactly 1 crystal is awarded in total.Count expected conflicts separately from technical errors.
Peak test profile exceeded100 sessions × 640 = 64,000 inputs/s as the total peakRapid changes in the area of interest cause visible gaps.

Limit snapshot traffic

Validation
Many distant characters enlarge each state snapshot.
Reaction
Measure visibility range and snapshot rate, then transmit only relevant characters.

Conflicts on the shared entity

Validation
P-21 and P-22 send valid pickup commands for G-21 in the same tick. Test both server-side input orders: the first valid command in that order wins; the other receives already allocated. Exactly 1 crystal is awarded in total.
Reaction
Count expected conflicts separately from technical errors.

Peak test profile exceeded

Validation
100 sessions × 640 = 64,000 inputs/s as the total peak
Reaction
Rapid changes in the area of interest cause visible gaps.

Limit snapshot traffic

Limit snapshot traffic

Measure visibility range and snapshot rate, then transmit only relevant characters.

Many distant characters enlarge each state snapshot.

640 KiB/s is a separate assumption before overhead and must be checked on the transport.

Alternative considered
Sending every character all the time simplifies debugging but increases traffic.
Trade-off
A changed area of interest requires a complete fresh update.
Reassess
Rapid changes in the area of interest cause visible gaps.

Terms in this step

Limit snapshot traffic
640 KiB/s is a separate assumption before overhead and must be checked on the transport.

Try it yourself

Many distant characters increase snapshot size. Choose two metrics and justify an initial action.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
Outgoing bytes per session and visible-character count per recipient show fanout; also monitor snapshot age.
Second part of the solution
A limited area of interest reduces unnecessary traffic. When it changes, deliver a complete new view so that characters are not missing.

Apply to your project

Which corresponding assumption would you test first in your project? Consider this trigger: Rapid changes in the area of interest cause visible gaps.

Step 9 examines abuse in context.