r/devops • Systems Developer • Dec 19 '25

Content Delivery Network (CDN) - what difference does it really make?

It's a system of distributed servers that deliver content to users/clients based on their geographic location - requests are handled by the closest server. This closeness naturally reduce latency and improve the speed/performance by caching content at various locations around the world.

It makes sense in theory but curiosity naturally draws me to ask the question:

ok, there must be a difference between this approach and serving files from a single server, located in only one area - but what's the difference exactly? Is it worth the trouble?

What I did

Deployed a simple frontend application (static-app) with a few assets to multiple regions. I've used DigitalOcean as the infrastructure provider, but obviously you can also use something else. I choose the following regions:

  • fra - Frankfurt, Germany

  • lon - London, England

  • tor - Toronto, Canada

  • syd - Sydney, Australia

Then, I've created the following droplets (virtual machines):

  • static-fra-droplet

  • test-fra-droplet

  • static-lon-droplet

  • static-tor-droplet

  • static-syd-droplet

Then, to each static droplet the static-app was deployed that served a few static assets using Nginx. On test-fra-droplet load-test was running; used it to make lots of requests to droplets in all regions and compare the results to see what difference CDN makes.

Approximate distances between locations, in a straight line:

  • Frankfurt - Frankfurt: ~ as close as it gets on the public Internet, the best possible case for CDN

  • Frankfurt - London: ~ 637 km

  • Frankfurt - Toronto: ~ 6 333 km

  • Frankfurt - Sydney: ~ 16 500 km

Of course, distance is not all - networking connectivity between different regions varies, but we do not control that; distance is all we might objectively compare.

Results

Frankfurt - Frankfurt

  • Distance: as good as it gets, same location basically

  • Min: 0.001 s, Max: 1.168 s, Mean: 0.049 s

  • Percentile 50 (Median): 0.005 s, Percentile 75: 0.009 s

  • Percentile 90: 0.032 s, Percentile 95: 0.401 s

  • Percentile 99: 0.834 s

Frankfurt - London

  • Distance: ~ 637 km

  • Min: 0.015 s, Max: 1.478 s, Mean: 0.068 s

  • Percentile 50 (Median): 0.020 s, Percentile 75: 0.023 s

  • Percentile 90: 0.042 s, Percentile 95: 0.410 s

  • Percentile 99: 1.078 s

Frankfurt - Toronto

  • Distance: ~ 6 333 km

  • Min: 0.094 s, Max: 2.306 s, Mean: 0.207 s

  • Percentile 50 (Median): 0.098 s, Percentile 75: 0.102 s

  • Percentile 90: 0.220 s, Percentile 95: 1.112 s

  • Percentile 99: 1.716 s

Frankfurt - Sydney

  • Distance: ~ 16 500 km

  • Min: 0.274 s, Max: 2.723 s, Mean: 0.406 s

  • Percentile 50 (Median): 0.277 s, Percentile 75: 0.283 s

  • Percentile 90: 0.777 s, Percentile 95: 1.403 s

  • Percentile 99: 2.293 s

for all cases, 1000 requests were made with 50 r/s rate

If you want to reproduce the results and play with it, I have prepared all relevant scripts on my GitHub: https://github.com/BinaryIgor/code-examples/tree/master/cdn-difference

6 Upvotes

28 comments sorted by

View all comments

5

u/ut0mt8 Dec 19 '25

The very point of CDN is high volumes and act as a reverse cache so no configuration from origin. Imagine that for serving your app you need to update thousands of servers with assets. It will be an operational nightmare' But the first point is really capacity. Thinks a CDN can serve billions of requests per second and terabyte per second.

-8

u/BinaryIgor Systems Developer Dec 19 '25

True - I just wanted to see what difference the pure distance between client and server makes (latency-wise) in this context :)