内容简介:While working on my new project,I thought it would be nice to share these results publicly as I found them somewhat surprising and illuminating.AWS S3and
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.
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
World P90
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.
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
我的第一本算法书
[日]石田保辉、[日]宮崎修一 / 张贝 / 人民邮电出版社 / 2018-10 / 69.00元
本书采用大量图片,通过详细的分步讲解,以直观、易懂的方式展现了7个数据结构和26个基础算法的基本原理。第1章介绍了链表、数组、栈等7个数据结构;从第2章到第7章,分别介绍了和排序、查找、图论、安全、聚类等相关的26个基础算法,内容涉及冒泡排序、二分查找、广度优先搜索、哈希函数、迪菲 - 赫尔曼密钥交换、k-means 算法等。 本书没有枯燥的理论和复杂的公式,而是通过大量的步骤图帮助读者加深......一起来看看 《我的第一本算法书》 这本书的介绍吧!