6 ms·
Don't put Cloudflare in front of a Cloud egress bill. i.e. don't do this: Azure|Amazon > Cloudflare Always use your own proxy where the egress is well within y
by buro9 5y ago
Don't put Cloudflare in front of a Cloud egress bill. i.e. don't do this: Azure|Amazon > Cloudflare
Always use your own proxy where the egress is well within your free tier, i.e. do this: Azure|Amazon > Hetzner|Linode > Cloudflare
Why?
Because Cloudflare cache is a massively multi-tenant LRU cache and whilst hot files will be cached well (and with Cloudflare Tiered Cache even better - but this itself is a cost) anything else is still going to expose you to some degree of egress cost.
When I exposed AWS to the web I paid $3k per month to AWS. With Cloudflare in front of AWS I paid $300 per month to AWS. With Linode in front of AWS and behind Cloudflare I paid $20 per month to Linode and about $12 per month to AWS.
A Linode, Hetzner instance... or any other dumb cheap web server that comes with a healthy free tier of bandwidth is all you need to set up a simple nginx reverse proxy and have it cache things to disk https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ https://docs.nginx.com/nginx/admin-guide/content-cache/conte...
- sascha_sl 5y agoOr simply use a proper CDN that doesn't pretend to eat all the cost for a flat fee but then sometimes does not. BunnyCDN has an amazing volume tier at half a cent per GB.
- buro9 5y agoOh exactly that. Or if caching is your biggest priority then Fastly or Akamai will shine too. But if you're balancing all considerations and want the cheap "good enough" caching with the DDoS protection, free TLS certs, and unmetered (assuming you aren't imgur or something)... then Cloudflare does a great job at being good enough. And for those sharp edges... drop in a proxy of your own, or layer your CDNs.
- _xnmw 5y agoI don't understand, what is the advantage of Cloudflare over Fastly or Akamai if caching is not your biggest priority? Does Cloudflare have better DDoS protection, or something else?
- jpgvm 5y agoYes among other things. Also edge compute, etc. Fastly comes close on a lot of fronts (and does better at a few things) but unless you are godlike with Varnish scripting it's a lot harder to make it do what you want than Cloudflare.
- brianwawok 5y agoOPs use case is a couple giant zip files. Edge compute is real cool, but not something a lot of people need when they think of CDN.
- jpgvm 5y agoI interpreted the question as "if caching -isn't- your biggest priority". i.e what does it do better assuming giant zip files isn't the main thing you are interested in. So I'm not really responding to OP but rather the commenter I replied to. :)
- _xnmw 5y agoThanks this is really helpful, I'm planning a delicate migration to a CDN and it's a tough choice. Cloudflare just seems like "an everything machine" from their marketing website, I'm struggling to understand how I would actually use it for a monolithic website + API.
- jpgvm 5y agoIt is pretty much an "everything machine". I think they are positioning themselves as a platform alternative to having a separate origin + CDN. i.e you develop your entire application with Workers + Durable Objects + R2. As a CDN it's pretty great though, I have managed very very large properties behind Cloudflare and they have always gone above and beyond for us when big DDoS have came our way.
- KerryJones 5y agoIn this scenario are you saying AWS/Azure > BunnyCDN > Cloudflare? Or just straight AWS/Azure > Cloudflare?
- reitzensteinm 5y agoWill BunnyCDN reliably keep an 18gb file in cache without hitting origin? I use and like Bunny, but relying on that to not get a massive bill in the mail scares the shit out of me.
- PaywallBuster 5y agothey also have storage feature, so they could
- jimbobimbo 5y agoAzure has its own CDN. If one wants to do Cloudfare -> CDN -> Azure Storage, then at least let it be Azure CDN in the middle, not another cloud provider in the mix. ¯\_(ツ)_/¯
- z3t4 5y agoOr simply run everything on your own server. All those middlemen are going to kill any latency improvements you get from anycast edge servers.
- XCSme 5y ago> Azure|Amazon > Hetzner|Linode > Cloudflare Why not directly Hetzner|Linode > Cloudflare?
- nostrebored 5y agoSo that you incur as much downtime risk as possible, obviously. I hate these 'cloud economics' optimizations that people tend to try.
- ajmurmann 5y agoThe best setup will forever remain Heroku free instance tier with a free Pingdom account providing traffic to keep it from getting shutdown
- ipaddr 5y agoThe risk that your service becomes faang popular and you suddenly need unlimited everything and need it immediately? It is possible but highly unlikely. The more likely scenerio is you just continue overpay like a lot of others waiting for the moment. If that moment happens you realize with the sudden popularity your store inventory is sold out so you couldn't profit off of the extra traffic anyhow.
- squeaky-clean 5y agoNo, downtime risk as in now you have 3 separate systems and organizations that can have unexpected downtime and consequently so will your app.
- rawtxapp 5y agoIf you use argo caching on Cloudflare, it should reduce origin server load even more. Essentially, instead of going directly to your origin, cloudflare endpoint will first reach to it's root node to see if it's cached there and only that node is allowed to communicate with your origin. I see like ~95% cache hits with that turned on.
- deleted 5y ago[deleted]
- edub 5y agoIf you're going to have an intermediary proxy that you run, for AWS perhaps use Lightsail. It is price competitive, and includes more bandwidth than Linode/DigitalOcean/Vultr for the price.
- klohto 5y agoYou are not allowed to use Lightsail once you use more professional services on AWS atleast per ToS
- edub 5y agoInteresting. In this example where the parent comment discusses using a proxy from AWS to Linode/Hetzner to Cloudflare, then I'd go with someone in the Bandwidth Alliance, which would include Linode and Vultr.
- InvaderFizz 5y agoHave either of those actually implemented Bandwidth Alliance? Last I looked(few months ago), the only outfit that had actually done anything on that was Backblaze. Vultr and Linode were nothing more than announcements with no actual cost savings for customers implemented.
- mappu 5y agoDo you have a more detailed citation for that? At $DAYJOB we seem to be using Lightsail (for non-cache purposes) along with some "real AWS" resources without a problem,
- RKearney 5y agoAWS Service Terms[0] 51. Amazon Lightsail 51.3. You may not use Amazon Lightsail in a manner intended to avoid incurring data fees from other Services (e.g., proxying network traffic from Services to the public internet or other destinations or excessive data processing through load balancing or content delivery network (CDN) Services as described in the Documentation), and if you do, we may throttle or suspend your data services or suspend your account. [0] https://aws.amazon.com/service-terms/ https://aws.amazon.com/service-terms/
- martindbp 5y agoI've switched to Backlaze B2, which has a bandwidth alliance with Cloudflare. Even without it, B2 egress is something like 1/5th of S3, so may be worth thinking about.
- zrail 5y agoAnother option if Linode's included bandwidth + overages is too much is a dedicated box from Reliable Site. I'm not a customer nor am I affiliated with them at all, I just occasionally check in on their low end prices and noticed that they've started included an unmetered 1Gbps port with every host. https://www.reliablesite.net https://www.reliablesite.net (search HN and reddit for that URL, you'll see they've been around and recommended for a really long time).
- ddlutz 5y agoWhy not use the CDN of the cloud provider you are on? Azure Storage > Azure CDN
- pojzon 5y agoBecause its order pf magnitude more expensive like anything on the cloud really..
- bastawhiz 5y agoAzure CDN offers almost no discount on egress over Azure storage directly. The same is the case with Amazon's equivalent services.
- tills13 5y agoReducing CloudFlare to a CDN is a disservice. They have some amazing services like Bot Management and Workers that make them very appealing. The CDN is just a nice bonus.
- cuham_1754 5y agoHow about Amazon Lightsail? It price structure is basically the same with Hetzner or Linode, and you get it in-house if you use AWS.
- manquer 5y agoIt is not compute cost it is b/w costs. That is pretty much same beyond free tier within AWS .
- deleted 5y ago[deleted]
- canucker2016 5y agoOr Troy Hunt can ping his Cloudflare contacts and see if he can get access to Cloudflare R2 Storage. see https://blog.cloudflare.com/introducing-r2-object-storage/ https://blog.cloudflare.com/introducing-r2-object-storage/ From the Cloudflare blog, it seems R2 would've handled this exact situation - auto-migration of cloud S3-like-storage objects - download from cloud-storage just once and cache in R2 for Cloudflare to serve.
- lewisl9029 5y agoHas anyone gotten access to R2 yet? I signed up but haven't heard back myself. Would love to find out if you can write to any/every region and have things replicate, or if you have to write to a single region. BunnyCDN's edge storage solution looked interesting until I found out it only supported writes to a single region. Hoping R2 might be my savior here, otherwise will probably have to roll my own active-active minio cluster, which I'm not looking forward to maintaining. Other suggestions welcome!
- jitbit 5y agoCloudFlare tiered cache is now free BTW