12

Static Hosting Benchmark 2020

 4 years ago
source link: https://www.pierbover.com/posts/static-hosting-benchmark-2020/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
uMN7bqN.jpg!web

While working on my new project, PLUMA , I spent a couple of days testing and comparing our content infrastructure with the most popular static hosts and some other options.

I thought it would be nice to share these results publicly as I found them somewhat surprising and illuminating.

Providers tested

  • AWS S3 + CloudFront
  • Cloudflare Workers Sites
  • Digital Ocean Object Storage (with and without CDN)
  • Firebase Hosting
  • Netlify
  • PLUMA
  • Stackpath
  • Vercel (previously ZEIT)

AWS S3and Stackpath are running from a single bucket in the US and using their own CDN. I imagine some AWS guru could configure cross region replication with Route 53, Lambda at Edge, and whatnot but this totally escapes me.

I have no idea how Firebase , Netlify , or Vercel are serving their static content. I imagine they have storage buckets in a couple of locations and are obviously using their own CDN on top of those buckets.

Cloudflare Workers Sitesis not your typical static hosting service. Files are actually stored in their KV service which works kinda like a pull CDN for values instead of files. Responses are then served using JavaScript functions running at the edge from KV or from their Cache API.

Digital Ocean Object Storageis not really for serving static websites but I thought it would be cool to include results from a bucket in NY with no CDN to compare. I also included results using their CDN to get more data points.

PLUMAis not really a static host either since it's serving dynamic content but I've included the results here for future reference.

Methodology

First I crafted a very simple index.html and uploaded it to all those providers.

yIBJZzj.png!web

Then I used Turbobytes Pulse to get results from a number of worldwide locations. Turbobytes is actually running these tests using agents from end-user networks which is nice. See here if you'd like to host a Pulse agent on your network.

Unfortunately not all Pulse agents are online at all times. I could never catch online agents in Latin America or the West Coast of the US and there were far more active agents in Europe. Since this most likely biased the global results I've included regional numbers too. I think this is still preferable than getting results from servers that in many cases will produce latencies of less than 1ms.

To get cached and uncached CDN results I did the tests on random times over a number of days. I did the same number of tests on all providers to get a similar percentage of cached requests.

I only used the default domains given by the hosting providers to avoid any DNS shenanigans. I also kept the default caching times for each provider which is probably the most common use case. All tests were done over HTTPS.

Enough preambles! Let's get to the plat de résistance :

Results

All values measure time-to-first-byte (TTFB) and are rounded to the closest millisecond.

World

Min Median Average P90 Max Netlify 2ms 28ms 43ms 49ms 918ms Digital Ocean CDN 7ms 22ms 46ms 78ms 675ms Cloudflare Workers 9ms 54ms 64ms 101ms 469ms Vercel 2ms 31ms 83ms 333ms 705ms AWS S3 1ms 23ms 88ms 386ms 966ms PLUMA 9ms 70ms 96ms 191ms 580ms Stackpath 6ms 25ms 122ms 395ms 991ms Firebase 2ms 28ms 125ms 364ms 823ms Digital Ocean 6ms 112ms 141ms 262ms 720ms

World Average

eyuyQjA.png!web

World P90

eIvUfaY.png!web

Asia and Oceania

Min Median Average P90 Max Netlify 2ms 42ms 76ms 232ms 918ms AWS S3 2ms 36ms 79ms 52ms 966ms Cloudflare Workers 13ms 54ms 79ms 117ms 469ms Vercel 2ms 42ms 87ms 372ms 609ms Digital Ocean CDN 29ms 49ms 89ms 233ms 675ms PLUMA 19ms 68ms 106ms 253ms 471ms Firebase 2ms 131ms 194ms 449ms 555ms Stackpath 30ms 214ms 226ms 776ms 991ms Digital Ocean 231ms 258ms 265ms 291ms 694ms

Green: better than global | Red: worse than global

Europe

Min Median Average P90 Max Digital Ocean CDN 7ms 19ms 29ms 31ms 657ms Netlify 10ms 22ms 30ms 40ms 328ms Cloudflare Workers 9ms 52ms 57ms 87ms 280ms PLUMA 9ms 67ms 86ms 167ms 539ms Vercel 8ms 28ms 89ms 410ms 705ms Firebase 5ms 17ms 95ms 317ms 823ms AWS S3 1ms 15ms 97ms 415ms 919ms Stackpath 6ms 22ms 105ms 425ms 811ms Digital Ocean 74ms 108ms 112ms 128ms 720ms

Green: better than global | Red: worse than global

North America

Min Median Average P90 Max Stackpath 6ms 15ms 28ms 74ms 203ms Digital Ocean CDN 9ms 16ms 40ms 179ms 318ms Digital Ocean 6ms 45ms 40ms 65ms 103ms Netlify 4ms 31ms 41ms 55ms 586ms Vercel 11ms 34ms 53ms 70ms 340ms AWS S3 4ms 24ms 68ms 202ms 263ms Cloudflare Workers 38ms 57ms 69ms 98ms 234ms PLUMA 28ms 79ms 121ms 311ms 580ms Firebase 2ms 36ms 130ms 314ms 609ms

Green: better than global | Red: worse than global

Regions

Reqs. Min Median Average P90 Max World 5273 1ms 41ms 90ms 256ms 991ms Asia & Oceania 1318 2ms 51ms 132ms 290ms 991ms Europe 3240 1ms 30ms 78ms 178ms 919ms North America 715 2ms 39ms 66ms 198ms 609ms

Rankings

World Asia EU NA Netlify 1 1 2 4 Digital Ocean CDN 2 5 1 2 Cloudflare Workers 3 2 3 7 Vercel 4 4 5 5 AWS S3 5 3 7 6 PLUMA 6 6 4 8 Stackpath 7 8 8 1 Firebase 8 7 6 9 Digital Ocean 9 9 9 3

Rankings on each region based on average latency sorted by global average

Insights

Global vs regional

The big difference between regions is most likely caused by the locations of the origin files and the different strategies adopted by each provider.

Cloudflare Workers seem the least affected by regional variations. It makes sense as Cloudflare runs on many locations all over the world and AFAIK Workers are pushed to many of those locations.

Which static hosting provider would I recommend?

After collecting all this data and (I think) extracting every bit of useful information my conclusion is: the more traffic your have the less it matters. If you look at the TTFB values of cached responses (min and median) all providers have exceptionally good results.

That said, it's most likely your traffic will be semi random bursts of traffic in different regions. In that case I think it's fair to say that generally speaking Netlify is the strongest option, even with their free plan. They also have a "High-Performance Edge" add-on which should speed things up even more but at $1,000 USD per month it was a bit pricey for this benchmark.

Cloudflare Workers Sites

If you've ever used cloud functions I think you will agree it's impressive that Workers can compete neck to neck with static files. In these results I see no trace of the infamous cold starts that still plague cloud functions from AWS, Google, and Azure.

Digital Ocean

I gotta admit I was very surprised by the performance of Digital Ocean too. I expected results without the CDN to be much worse considering roundtrips from around the world to a bucket in NY.

Maybe I should do another test with all object storage providers without using any CDN.

I didn't expect their CDN to be that good either. I wrongly assumed this service would be a hobby project for them, after all Digita Ocean is mostly known for their compute droplets. With such great results and priced at $0.01 per GB of bandwidth (worldwide) it is a fantastic offer. Hopefully they will allow object storage to host websites in the future .

Conclusion

Well, this is certainly not the ultimate benchmark. Alas, we do the best with what we have available.

In any case I hope this has been interesting or at least entertaining for you.

If you have any comments hit me up on Twitter or send me an email at yo@ at this domain.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK