Hacker News new | ask | show | jobs
by jay6282 1271 days ago
The hard part of building a CDN is to know when you need it. 99.9% of all websites with CDN do not need it. Serving static files consumes so little resources that a single server can serve billions of users as long as you dont use script for serving the file. The most cost-effective with also the lowest latency solution is to never use CDN. If your webserver provider charge you a lot for traffic you are better off using another provider.
4 comments

Static files can be relatively large, like pictures, or sounds, or even videos. At busier moments, the p99 latency can become pretty bad if you only have one virtual NIC serving them.

Also, geography: ping time from Singapore to the US can never be negligibly short, which is pretty noticeable during TLS handshakes.

But yes, likely these considerations do not matter for 90% of websites (not 99.9% though).

It's definitely 99.9% if the websites aren't filtered at all. A lot lower if you're only taking about the top 100 visited websites according to Alexa or apple however...
In OP’s premise, they were filtered by “websites who chose to be served by a CDN”.
> The most cost-effective with also the lowest latency solution is to never use CDN

The lowest latency solution is to put the content near the user and a CDN is probably the easiest way of doing that if someone needs to server a geographically dispersed audience

> The most cost-effective with also the lowest latency solution is to never use CDN.

CloudFlare is free at my tier and gives me the ability to have the lowest latency.

> The hard part of building a CDN is to know when you need it. 99.9% of all websites with CDN do not need it.

What exactly leads you to believe you can tell what 99.9% of all websites need?

Unless you believe 99.9% of websites are only accessed by your upstairs neighbors, CDNs provide a couple of important business and operational advantages.

Just to illustrate how wrong and misguided your personal assumption is, CDNs are primarily used to cut down latency, which in accesses from other regions can easily go beyond 300ms. Unless you somehow think that it's ok for your users to be subjected to a bad user experience, a basic CDN service is all you need to employ to lower those latencies by an order of magnitude.

Thats interesting because when I added a CDN to one of my projects to serve the assets (mostly images) my latency went up and I would preferred not serving them through the CDN but didn’t have a choice because of the large number of files.

I accept that my images are being served a bit slower but with the compromise that I can server a lot more images.

I also think the person your are replying to is correct. The CDN makes the user experience worse but saves me money, that’s an unfortunate sacrifice.