News for hackers. Stuff that matters.
Re:I got pwned by my cloud costs by buro9 on Monday January 24, 2022 @04:44AM (#30055345)
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/conte...

Re:I got pwned by my cloud costs by sascha_sl on Monday January 24, 2022 @07:10AM (#30056657)
Or 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.
Re:I got pwned by my cloud costs by buro9 on Monday January 24, 2022 @07:14AM (#30056704)
Oh 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.

Re:I got pwned by my cloud costs by igammarays on Monday January 24, 2022 @09:13AM (#30057756)
I 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?
Re:I got pwned by my cloud costs by jpgvm on Monday January 24, 2022 @11:51AM (#30060227)
Yes 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.

Re:I got pwned by my cloud costs by igammarays on Tuesday January 25, 2022 @03:15AM (#30069467)
Thanks 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.
Re:I got pwned by my cloud costs by jpgvm on Tuesday January 25, 2022 @03:57AM (#30069745)
It 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.

Re:I got pwned by my cloud costs by brianwawok on Monday January 24, 2022 @01:32PM (#30061814)
OPs 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.
Re:I got pwned by my cloud costs by jpgvm on Monday January 24, 2022 @10:22PM (#30067524)
I 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. :)

Re:I got pwned by my cloud costs by KerryJones on Monday January 24, 2022 @11:51AM (#30060238)
In this scenario are you saying

AWS/Azure > BunnyCDN > Cloudflare?

Or just straight AWS/Azure > Cloudflare?

Re:I got pwned by my cloud costs by reitzensteinm on Monday January 24, 2022 @12:26PM (#30060805)
Will 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.
Re:I got pwned by my cloud costs by PaywallBuster on Monday January 24, 2022 @01:48PM (#30062066)
they also have storage feature, so they could
Re:I got pwned by my cloud costs by jimbobimbo on Monday January 24, 2022 @07:56PM (#30066457)
Azure 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. ¯\_(ツ)_/¯
Re:I got pwned by my cloud costs by z3t4 on Tuesday January 25, 2022 @03:15PM (#30077437)
Or simply run everything on your own server. All those middlemen are going to kill any latency improvements you get from anycast edge servers.
Re:I got pwned by my cloud costs by martindbp on Monday January 24, 2022 @01:12PM (#30061515)
I'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.
Re:I got pwned by my cloud costs by rawtxapp on Monday January 24, 2022 @11:52AM (#30060251)
If 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.
Re:I got pwned by my cloud costs by bastawhiz on Monday January 24, 2022 @09:25PM (#30067106)
Argo does not affect caching, only performance. You're maybe mistaking it for tiered caching or a custom caching topology.
Re:I got pwned by my cloud costs by rawtxapp on Monday January 24, 2022 @10:39PM (#30067653)
Yes, they call it Argo Tiered Cache under Caching tab.
Re:I got pwned by my cloud costs by XCSme on Monday January 24, 2022 @08:17AM (#30057200)
> Azure|Amazon > Hetzner|Linode > Cloudflare

Why not directly Hetzner|Linode > Cloudflare?

Re:I got pwned by my cloud costs by nightpool on Monday January 24, 2022 @10:24AM (#30058756)
Because Hetzner and Linode VPSs have fixed disk sizes, while Azure and AWS have basically infinite storage. You use your cheap commodity VPS as a cache, not a source-of-truth.
Re:I got pwned by my cloud costs by manquer on Monday January 24, 2022 @04:18PM (#30064193)
Many of them have managed object storage services as well. OVH[1] and Linode[2], scaleway[3] have them, that should scale for most use cases and are S3 compatible APIs

Also Azure and Linode, Scaleway Backblaze and others are part of Cloudflare bandwidth alliance [4] so there shouldn't be egress fees between the two.

It is really only AWS which is a problem, you don't need this setup with any other provider.

[1] https://www.ovhcloud.com/en/public-cloud/object-storage/

[2] https://www.linode.com/products/object-storage/

[3] https://www.scaleway.com/en/object-storage/

[4] https://www.cloudflare.com/bandwidth-alliance/

Re:I got pwned by my cloud costs by XCSme on Monday January 24, 2022 @11:01AM (#30059276)
You can use block storage for scalable disk size: https://www.linode.com/products/block-storage/
Re:I got pwned by my cloud costs by throwawaygh on Monday January 24, 2022 @12:41PM (#30061036)
But then you're right back to the cloud billing problem, right?
Re:I got pwned by my cloud costs by XCSme on Monday January 24, 2022 @12:55PM (#30061234)
That's right, auto-scaling comes with this problem, but at least you removed one extra service/point of failure.
Re:I got pwned by my cloud costs by bastawhiz on Monday January 24, 2022 @09:27PM (#30067118)
That's assuming you trust Linode block storage as much as you trust S3.
Re:I got pwned by my cloud costs by XCSme on Tuesday January 25, 2022 @05:51AM (#30070424)
Trust in what sense? Uptime, security, privacy? I am not sure whether I can say I trust one or another, by personally I had a good experience with VPS/dedicated server providers, more than with cloud (AWS/GCP).
Re:I got pwned by my cloud costs by FpUser on Monday January 24, 2022 @12:58PM (#30061280)
Out of curiosity I tried to look up their pricing and the first thing I am greeted with when launching their price calculator is "you must allow functional cookies".

I disabled all shields for their side and still the same thing. Waste of time

Re:I got pwned by my cloud costs by XCSme on Monday January 24, 2022 @01:03PM (#30061368)
I personally never used Linode and can not recommend nor talk against it, I was just pointing out that if you want scalable solutions AWS is not the only answer.
Re:I got pwned by my cloud costs by remram on Monday January 24, 2022 @02:31PM (#30062697)
If your cache is much smaller than the data, it will be ineffective, unless you think everyone keeps downloading the same tiny subset of files. That last assumption works for web content (e.g. newest articles see more hits) but probably not for data.
Re:I got pwned by my cloud costs by nostrebored on Monday January 24, 2022 @09:43AM (#30058135)
So that you incur as much downtime risk as possible, obviously.

I hate these 'cloud economics' optimizations that people tend to try.

Re:I got pwned by my cloud costs by ipaddr on Monday January 24, 2022 @01:21PM (#30061633)
The 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.

Re:I got pwned by my cloud costs by squeaky-clean on Monday January 24, 2022 @02:37PM (#30062788)
No, downtime risk as in now you have 3 separate systems and organizations that can have unexpected downtime and consequently so will your app.
Re:I got pwned by my cloud costs by Sebb767 on Monday January 24, 2022 @01:36PM (#30061879)
There's a clear trade-off between downtime risk and cost explosion risk. For a hobby/non-profit project, risking the downtime to possibly save 7k€ plus surely saving the surcharge of "scalability" is definitely worth it.
Re:I got pwned by my cloud costs by ajmurmann on Monday January 24, 2022 @11:52AM (#30060252)
The best setup will forever remain Heroku free instance tier with a free Pingdom account providing traffic to keep it from getting shutdown
Re:I got pwned by my cloud costs by jeromegv on Monday January 24, 2022 @12:58PM (#30061281)
Free heroku as a maximum number of hours a day. The ping hack isn’t working anymore.
Re:I got pwned by my cloud costs by ajmurmann on Monday January 24, 2022 @02:50PM (#30062998)
Sorry, that comment want really serious and mostly a dolly example of bizarre cloud pricing hacking
Re:I got pwned by my cloud costs by zrail on Monday January 24, 2022 @01:50PM (#30062103)
Another 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

(search HN and reddit for that URL, you'll see they've been around and recommended for a really long time).

Re:I got pwned by my cloud costs by edub on Monday January 24, 2022 @01:02PM (#30061362)
If 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.
Re:I got pwned by my cloud costs by klohto on Monday January 24, 2022 @01:17PM (#30061568)
You are not allowed to use Lightsail once you use more professional services on AWS atleast per ToS
Re:I got pwned by my cloud costs by mappu on Monday January 24, 2022 @02:33PM (#30062729)
Do 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,
Re:I got pwned by my cloud costs by RKearney on Monday January 24, 2022 @08:23PM (#30066657)
AWS 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/

Re:I got pwned by my cloud costs by akerl_ on Monday January 24, 2022 @09:33PM (#30067160)
I think you’re expanding this clause past what it says.

The clause prohibits you from using Lightsail to cheat other services. So, per their example, you couldn’t set up a Lightsail instance as a reverse proxy between the internet and an ELB, to take advantage of Lightsail’s higher transfer quotas and “in-region” traffic from Lightsail to ELBs.

Hosting a site on Lightsail and hosting other things on other AWS services is fine.

Re:I got pwned by my cloud costs by RKearney on Monday January 24, 2022 @10:29PM (#30067574)
I am not the OP. The terms indicate you cannot use it to proxy traffic to bypass bandwidth costs. The grandparent comment suggested using Lightsail to do this, and it is a violation of the TOS. The parent comment, however, stipulated that you are not allowed to use Lightsail at all, which is indeed wrong. I was just posting the relevant portion of the TOS which applies to the grandparent comment, and clarifies on the parent comment (which is inaccurate)
Re:I got pwned by my cloud costs by klohto on Tuesday January 25, 2022 @02:54AM (#30069328)
Thank you for the correction! Second time I made this claim but always forget it’s just about the traffic…
Re:I got pwned by my cloud costs by Matheus28 on Monday January 24, 2022 @09:54PM (#30067321)
That's insane. But not a surprise, lightsail only exists so aws can say they offer similar pricing to Linode/DigitalOcean/Vultr/etc... as long as you don't ever plan to grow
Re:I got pwned by my cloud costs by edub on Monday January 24, 2022 @01:37PM (#30061891)
Interesting. 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.
Re:I got pwned by my cloud costs by InvaderFizz on Monday January 24, 2022 @05:47PM (#30065165)
Have 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.
Re:I got pwned by my cloud costs by ddlutz on Monday January 24, 2022 @02:53PM (#30063041)
Why not use the CDN of the cloud provider you are on? Azure Storage > Azure CDN
Re:I got pwned by my cloud costs by tills13 on Tuesday January 25, 2022 @05:34PM (#30079072)
Reducing 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.
Re:I got pwned by my cloud costs by pojzon on Monday January 24, 2022 @05:53PM (#30065239)
Because its order pf magnitude more expensive like anything on the cloud really..
Re:I got pwned by my cloud costs by bastawhiz on Monday January 24, 2022 @09:32PM (#30067153)
Azure CDN offers almost no discount on egress over Azure storage directly. The same is the case with Amazon's equivalent services.
Re:I got pwned by my cloud costs by canucker2016 on Monday January 24, 2022 @05:55PM (#30065260)
Or 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/

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.

Re:I got pwned by my cloud costs by lewisl9029 on Monday January 24, 2022 @06:38PM (#30065732)
Has 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!

Re:I got pwned by my cloud costs by cuham_1754 on Monday January 24, 2022 @04:04PM (#30064007)
How about Amazon Lightsail? It price structure is basically the same with Hetzner or Linode, and you get it in-house if you use AWS.
Re:I got pwned by my cloud costs by manquer on Monday January 24, 2022 @04:12PM (#30064113)
It is not compute cost it is b/w costs. That is pretty much same beyond free tier within AWS .
Re:I got pwned by my cloud costs by jitbit on Saturday January 29, 2022 @12:48PM (#30128482)
CloudFlare tiered cache is now free BTW