Chat delivery lab
Send messages to 30 users through four gateways with packet loss, gateway crashes and users who go offline. Compare showing messages on arrival with holding them for order, and duplicate checks on and off.
tick 60gateways up 3 of 4users online 15 of 30shown on arrival
What the screens show
- sent
- 600
- shown
- 565
- out of order
- 3.9%
- duplicates shown
- 0
Messages carry a sequence number per recipient. Out of order means a message appeared after one that was sent later.
Delivery work
- waiting for first delivery
- 35
- resends
- 127
- gateway crashes
- 1
- median / 99th percentile delay
- 0 / 18 ticks
A message that gets no acknowledgement is sent again. Messages for offline users wait in their inbox.
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| waiting | 35 | 3 | 35 |
After 60 ticks, 600 messages were sent and 565 were shown. 3.9 percent appeared out of order and 0 duplicates were shown. The server resent messages 127 times, and 1 gateway crashes happened. The median delay was 0 ticks and the 99th percentile 18.
What to try
Each one sets up a starting point. Then make the change it describes.
A calm network
Set loss, crashes and offline users to 0.
Look for. Every message arrives at once, in order, once. Nothing needs resending.
Loss reorders messages
Keep 10 percent loss and show messages on arrival.
Look for. A lost message is resent a few ticks later, after a newer one has landed. Some messages appear out of order.
Hold for sequence
Switch client ordering to hold for sequence.
Look for. Nothing appears out of order. A message waits for its predecessors, so the slowest deliveries get slower.
Lost acknowledgements duplicate
Turn the duplicate check off.
Look for. A message that arrived but whose acknowledgement was lost is sent again, and now it shows twice.
Offline users catch up
Raise users going offline to 5 percent a tick.
Look for. Messages wait in the inbox until the user returns, so the tail of the delay grows. The median stays small.
Gateway crashes
Set gateway crashes to 2 percent a tick and loss to 0.
Look for. Users on a dead gateway reconnect to another one and catch up from their inbox. Delivery is late but nothing is lost.
New to the idea? Read the lesson first. Every number here comes from a seeded simulator, so the same seed gives the same run.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms