matsuhub

3D experimentHow much can yoursystem take?

Raise the number of people on the site and watch a single server fall over while a scalable architecture switches machines on by itself. Response time, errors and machines running, computed live.

three.jsM/M/1autoscalingCDN
Fast
  • static file
  • dynamic request
  • queued
  • error

Drag to rotate

Architecture

150

Response time (p95)
239 ms
Errors
0%
Requests per second
68
App machines
1 · fixed
App CPU usage
13%
Database
on the same server
CDN
no CDN
Response time as traffic grows
100 ms1 s10 s101001k10k50k
Single serverScalablepeople at once

In the model, the single server starts failing at about 1,200 people at once. The scalable architecture holds up to about 47,000, with all 48 machines running.

How it works

How much can your system take?

What the model assumes

  • Each active person opens a page every 20 seconds. Each page makes 1 dynamic request (HTML or API) and fetches 8 static files (images, CSS, JavaScript).
  • A dynamic request takes 40 ms of CPU and runs 4 database queries of 3 ms each. A static file takes 2 ms.
  • Single server: one 4-core machine runs the application, the database and the static files.
  • Scalable architecture: the CDN serves 95% of static files; 2-core machines switch on and off to stay near 50% usage (minimum 2, maximum 48); 85% of database queries are reads, and a cache answers 70% of them; the primary database (8 cores) takes every write and shares the reads with up to 3 identical replicas.
  • New machines are ready instantly. In real life each one takes a while to boot and warm up, which is why predictable peaks such as Black Friday call for machines switched on ahead of time.
  • Response time: each part is treated as an M/M/1 queue, a simplification (on the single server the whole machine is one queue; on the scalable one, the application and the database are two). Mean time is service time divided by (1 − usage), and p95 is about 3 times the mean. We add up the queues and 60 ms of network.
  • Above 100% usage the queue grows without bound: the share of requests that doesn't fit becomes a timeout error.

These numbers are assumptions about a typical system, not measurements of a real one. They are for comparing the two architectures, not for sizing your system: for that, the right move is to measure with a real load test.

Why it matters

A post that goes viral or a Black Friday multiplies traffic in minutes. If the system doesn't scale, it goes down on the very day it would sell the most. And scaling doesn't mean paying a lot all year: machines switch on for the peak and off afterwards, and the panel shows how many are running at each moment.

Everything runs in your browser: the model is a pure TypeScript function (loadPose(people, architecture)), and the 3D scene, the numbers and the chart read from it every frame. That's why they never disagree.

Want this in your product?

The engineering behind the Lab is the same that goes into the systems we build for clients.