Direct origin vs CDN for images

A CDN keeps copies of popular files near users, so most reads never reach the origin. At 1,000 reads/s of 100 KB, the direct origin sends 6 GB in one minute. With a CDN, origin bytes stay under 0.6 GB and the bill falls from 16,590 USD/mo to 2,638 USD/mo.

Play the level

Users read the originTap or press Space to put a CDN in front

Direct origin · the origin sends 6.0 GB a minute

A CDN in front of the originTap or press Space to put a CDN in front

CDN in front · the origin sends 0.6 GB a minute

1,000 image reads each second return 100 KB each. Origin response bytes must stay below 0.6 GB in the 60 s run.

Case 1
Measure Goal Users read the origin A CDN in front of the origin
Origin egress under 0.6 GB 6 GB Fail 0.01 GB Pass
p99 latency under 250 ms 84 ms Pass 74 ms Pass
Monthly cost 16,590 USD/mo 2,638 USD/mo
Error rate 0% 0%
HTTP/2UsersObject stor…4 vCPU · 4 GB
HTTP/2UsersObject stor…4 vCPU · 4 GB
Users read the origin: misses a goal
HTTP/2HTTP/2UsersObject stor…4 vCPU · 4 GBCDN4 vCPU · 2 GB
HTTP/2HTTP/2UsersObject stor…4 vCPU · 4 GBCDN4 vCPU · 2 GB
A CDN in front of the origin: meets the goals

Case 2

The same site at 20 reads/s. Both pass with p99 124 ms. The direct origin costs 333 USD/mo and the CDN design 94 USD/mo.

Case 2
Measure Goal Users read the origin A CDN in front of the origin
Origin egress under 0.6 GB 0.12 GB Pass 0.01 GB Pass
p99 latency under 250 ms 124 ms Pass 124 ms Pass
Monthly cost 333 USD/mo 94 USD/mo
Error rate 0% 0%
HTTP/2UsersObject stor…4 vCPU · 4 GB
HTTP/2UsersObject stor…4 vCPU · 4 GB
Users read the origin: meets the goals
HTTP/2HTTP/2UsersObject stor…4 vCPU · 4 GBCDN4 vCPU · 2 GB
HTTP/2HTTP/2UsersObject stor…4 vCPU · 4 GBCDN4 vCPU · 2 GB
A CDN in front of the origin: meets the goals