Skip to content
Chaos Lab

Challenge 61 · intermediate · Delivery platform

Twelve pods, fewer riders

150 orders a second are placed. Each commits with an outbox row, and a relay publishes it to the order-events topic. Dispatch consumes that topic and asks the Maps API for travel times before it assigns a rider. Autoscaling on lag is already on.

At 10 seconds a match ends and orders triple. At 25 seconds the Maps API slows from 120 ms to 2.5 s a call, and dispatch has no timeout on it. From 40 to 90 seconds, dispatch may be at most 15 seconds behind, and it must not send a struggling Maps more than 150 calls a second.

ready00:00 / 01:30Success · 10 s–p99 · 10 s–order-events lag0 ordersKafka76k msg/sDispatch4 pods

Service map

Delivery platform · paused
no timeout75k pings/sCustomers of a quick-commerce app: about 10 minutes from order to door.300,000 riders online, each carrying about 1.5 orders at a time: room for 450,000 orders in flight. The ×3 surge needs 270,000.Customer traffic only. Riders connect through their own location gateway.Catalog and search reads: 85% of the customer API traffic.Answers 92% of catalog and search reads; the rest go to the catalog's own index.Cart, checkout and order status. Placing an order reserves stock, authorises payment, then commits the order and an outbox row in one transaction.Holds stock for an order at checkout, so two customers cannot buy the last unit.Every attempt for one order carries the same idempotency key, so a retry after the 2 s timeout cannot charge twice.The order and its outbox row commit together, so an event exists exactly when the order does.Reads the database log (change data capture) and publishes each outbox row to order-events. Orders never writes to Kafka itself.Partitioned by zone. 4 events per order. The lag shown is the dispatch group's backlog of orders.12 partitions → at most 12 consumers (classic consumer groups; Kafka 4.2 share groups lift this limit). Scaling out pauses consumption while partitions rebalance, so pre-scale before the dinner peak.Riders hold one long-lived connection each and stream positions over it. Separate from the customer API gateway.One position per rider every 4 s. Most of the messages in Kafka, and none of the lag.The only writer of the rider index.last-seen ZSET + sweeper evicts riders silent >30s; sharded by city. Written by the location service, read by dispatch.Pushes each rider's position, and order status, to the customers waiting on that rider: one socket per order in flight.
All components healthy.requestretrytrial call (half-open)failed

What changed

Turn on a fault or change a defence while the run plays. Its effect shows here: the 5 seconds before against 5 seconds after it settles.

Goal · measured 00:40–01:30

0 changes · par 2
  • Furthest behind on order-events ≤ 15 smeasuring from 00:40
  • Orders with a rider inside a minute ≥ 99.0%measuring from 00:40
  • Calls reaching Maps while it is slow ≤ 150 a secondmeasuring from 00:40

This is a simulation. Its numbers come from a model of a typical system, not from measuring real servers. The same link and seed always give the same run. How the Chaos Lab works.