Readit News logoReadit News
develatio · 2 years ago
I'll share my trick :)

Lightsail instances can be used to "proxy" data from other AWS resources (eg EC2 instances or S3 buckets). Each Lightsail instance has a certain amount of data transfer included in it's price ($3.5 instance has 1TB, $5 instance has 2TB, $10 instance has 3TB, $20 instance has 4TB, $40 instance has 5TB). The best value (dollar per transferred data) is the $10 instance, which gives you 3TB of traffic.

Using the data provided by the post:

3TB worth of traffic from an EC2 would cost $276.48 (us-east-1). 3TB worth of traffic from a S3 bucket would cost $69.

Note: one downside of using Lightsail instances is that both ingress and egress traffic counts as "traffic".

jonatron · 2 years ago
https://aws.amazon.com/service-terms/

> 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 technical documentation), and if you do, we may throttle or suspend your data services or suspend your account.

develatio · 2 years ago
A had a suspicion that this was against AWS's terms, but I never bothered to look if that was actually the case. Thank you for the heads up!
Hamuko · 2 years ago
At least AWS is fully aware how premium their normal data transfer is and that one might want to optimise those costs.
mmh0000 · 2 years ago
Yeah, but "service terms" are just recommendations that should often be ignored.
sangnoir · 2 years ago
> You may not use Amazon Lightsail in a manner intended to avoid incurring data fees from other Services

This requires proving the users intent, which is not obvious except in the most blatant of cases (i.e. using Lightsail as a bent-pipe by writing the exact bytes you're reading). If it is a "CSV to Parquet translation layer", how would AWS possibly prove it's anything other than what it claims to be? You'd be paying a few more cents for compute, but that's the price of plausible deniability

rfoo · 2 years ago
Here's another one:

You can download 1TB of data for free from AWS each month, as Cloudfront has a free tier [1] with 1TB monthly egress included. Point it to S3 or whatever HTTP server you want and voila.

[1] It used to be 50GB per month for the first 12 months. It was changed to 1TB free forever shortly after Cloudflare posted https://blog.cloudflare.com/aws-egregious-egress

overstay8930 · 2 years ago
That "shortly" was 2 years, that Cloudflare post had nothing to do with it, Amazon barely considers them a competitor to begin with.
andruby · 2 years ago
Nice!

Nitpick: $5 for 2TB is better than $10 for 3TB.

develatio · 2 years ago
Ooohhh!! It is, indeed!

Deleted Comment

intelVISA · 2 years ago
Nice trick but you are playing with fire due to the AWS' terms.
ishitatsuyuki · 2 years ago
GCP patched a similar loophole [1] in 2023 presumably because some of their customers were abusing it. I'd expect AWS to do the same if this becomes widespread enough.

[1]: https://cloud.google.com/storage/pricing-announce#network

rfoo · 2 years ago
Unlikely. The "loophole" GCP patched was that you can use GCS to transfer data between regions on the same continent for free. This is already non-free on AWS. What OP mentioned is that transferring data between availability zones *in the same region* also costs $0.02 per GB and can be worked around.
cedws · 2 years ago
I know of a way to get data out of GCP for free, although I haven't tried it in practice. Wonder if I could find a buyer for this info ;)
BonoboIO · 2 years ago
I got one for Azure, where it would be nearly free to egress data from Azure to any other cloud provider or the internet.

It works, but i have no use case for it. 100TB egress to the internet costs about 7000$ ... i think, i could do it for 20$-50$.

greyface- · 2 years ago
A guess: tunnel through 169.254.169.254 DNS server?
Cthulhu_ · 2 years ago
This doesn't feel like a loophole though, it feels like they have optimized S3 and intend your EC2 instances to use S3 as storage. But maybe not as transfer window, that is, they expect you to put and leave your data on there.
lijok · 2 years ago
There are tons of these tricks you can use to cut costs and get resources for free. It's smart, but not reliable. It's the same type of hacking that leads to crypto mining on github actions via OSS repos.

Treat this as an interesting hacking exercise, but do not deploy a solution like this to production (or at least get your account managers blessing first), lest you risk waking up to a terminated AWS account.

huslage · 2 years ago
I have used this and other techniques for years and never gotten shut down. Passing through S3 is also generally more efficient for distributing data to multiple sources than running some sync process.
boiler_up800 · 2 years ago
S3 storage costs are charged per GB month so 1 TB * .023 per GB / 730 hrs per month… should be 3 cents if the data was left in the bucket for an hour.[1]

However sounds like it was deleted almost right away. In that case the charge might be 0.03 / 60 if the data was around for a minute. Normally I would expect AWS to round this up to $0.01..

The TimedByteStorage value from the cost and usage report would be the ultimate determinant here.

[1] https://handbook.vantage.sh/aws/services/s3-pricing/

jakozaur · 2 years ago
S3 is a nice trick. More tricks:

1. Ask for discounts if you are a big AWS customer (e.g., spend $1mln+/year). At some point, they were huge for inter-AZ transfers.

2. Put things in one AZ. Running DB in "b" zone and your only server in "a" is even worse than just standardizing on one zone.

3. When using multiple AZ do load aware AZ balancing.

throwaway167 · 2 years ago
> Running DB in "b" zone and your only server in "a"

There must be use cases for this, but I lack imagination. Cost? But not cost?

jakozaur · 2 years ago
Defaults. Either as a code or using click ops.

Many companies run servers without considering AZ. Then you can get the "best" of the worlds:

1. Your service is down if either of AZs gets hiccups.

2. You pay network charges and latency cost.

sokoloff · 2 years ago
I can't see a reason to do this intentionally within a single account, but use cases with multiple accounts should be aware that what AZ has ID us-east-1a in Account 1 is not necessarily the same AZ that has the ID us-east-1a in Account 2.

https://docs.aws.amazon.com/ram/latest/userguide/working-wit...

QuadmasterXLII · 2 years ago
Cost, unlimited cost- but no cost.
pibefision · 2 years ago
4. Activate S3 Inteligent-Tier storage class?
danielklnstein · 2 years ago
This is great for saving on S3 storage costs!

But in the context of data transfer costs, this would actually increase the costs, because there's a small surcharge for Intelligent Tiering - and the only relevant storage class for sidestepping data transfer costs is standard storage (because it's the only one with free download), so Intelligent Tiering won't provide value.

endgame · 2 years ago
You've got to be careful of the automation charge with Intelligent Tiering.

https://discourse.nixos.org/t/the-nixos-foundations-call-to-...

lucidguppy · 2 years ago
This feels like the tech equivalent of tax avoidance.

If too many people do this - AWS will "just close the loophole".

There's not one AWS - there are probably dozens if not hundreds of AWS - each with their own KPIs. One wants to reduce your spend - but not tell you how to really reduce your spend.

If you make something complex enough (AWS) - it will be impossible for customers to optimize in any one factor - as everything is complected together.

karlkatzke · 2 years ago
This isn't a loophole. This is by design. AWS wants you to use specific services in specific ways, so they make it really cheap to do so. Using an endpoint for S3 is one of the ways they want you to use the S3 service.

Another example is using CloudFront. AWS wants you to use CloudFront, so they make CloudFront cheaper than other types of data egress.

lucidguppy · 2 years ago
If they wanted you to behave in specific ways logically - wouldn't their documentation be less ambiguous?

https://www.lastweekinaws.com/blog/aws-cross-az-data-transfe...

andrewstuart · 2 years ago
An alternative to sophisticated cloud cost minimization systems is…….. don’t use the cloud. Host it yourself. Or use Cloudflare which has 0 cents per gigabyte egress fees. Or just rent cloud servers from one of the many much cheaper VPS hosting services and don’t use all the expensive and complex cloud services all designed to lock you in and drain cash from your at 9 or 12 or 17 cents per gigabyte.

Seriously, if you’re at the point that you’re doing sophisticated analysis of cloud costs, consider dropping the cloud.

overstay8930 · 2 years ago
If you're at the point you're doing sophisticated cloud cost analysis you are doing the cloud right, because that is completely impossible anywhere else.

I swear the people who say go on premise have no idea how much the salary costs of someone who will not treat their datacenter like a home lab is. Even Apple iCloud is in AWS and GCP because of how economical it is, you suck at the cloud you think you have to go back on prem, or you just don't give a shit about reliability (start pricing up DDoS protection costs at anything higher than 10G and tell me the cloud is more expensive).

We spend 100k+ on AWS bandwidth and it's still cheaper than our DIA circuits because we don't have to pay network engineers to manage 3 different AZs.

dzikimarian · 2 years ago
Apparently we're doing the impossible for over 12 years now. Who knew?

Some people act like it's some kind of black magic. It's not. We've some customers in our DC and some on AWS for various reasons. AWS isn't less problematic. AWS is about 10x more expensive. Both on prem and cloud require people familiar with them and cloud-engineers are in no way cheaper.

Only meaningful problem is that on-prem requires some up front cost&time. That can be mitigated by leasing and other means, but indeed can be an issue for small businesses.

holoduke · 2 years ago
My small business once spend 50k per month on AWS. We brought that back to 800 dollars for a similar setup at Hetzner. I find this a significant number.
snug · 2 years ago
AWS and GCP are giving companies like Apple huge discounts so someone could say something like, "Even Apple iCloud is in AWS and GCP because of how economical it is"

There is too much nuance to say one is better than the other. In some cases using a IaaS is more economical, in other cases it's not.

For Apple, the same is also true[0] to say "Even Apple is running their own datacenters because of how economical it is"

0 - https://dgtlinfra.com/apple-data-center-locations/#:~:text=a....

qvrjuec · 2 years ago
>someone who will not treat their datacenter like a home lab

What does this mean? They steal company resources for themselves, or just configure things incompetently?

tiffanyh · 2 years ago
> on premise have no idea how much the salary costs of someone

I haven’t yet meet anyone at a company that heavily uses cloud and still doesn’t have the same number of salaried infra people as on-prem.

echelon · 2 years ago
You act like these problems are especially hard.

Active-active, five nines, fault tolerance. Hard stuff. But managing on-prem is no harder.

This is what we're paid for.

maeln · 2 years ago
> Seriously, if you’re at the point that you’re doing sophisticated analysis of cloud costs, consider dropping the cloud.

Which would mean that you loose part of the reason to use the cloud in the first place... A lot of org move to cloud based hosting because it enable them to go way further in FinOps / cost control (amongst many other thing).

This can make a lot of sense depending on your infra, if you have some fluctuation in you needs (storage, compute, etc...), cloud based solution can be a great fit.

At the end of the day, it is just a tool. I worked in places where I SSH´d into the prod bare-metal server to update our software, manage the firewall, check the storage, ... and all that manually. And I worked in places where we were using a cloud provider for most of our hosting needs. I also handle the transition from one to the other. All I can say is: It's a tool. "The cloud" is no better or worse than a bare-metal server or a VPS. It really depends on your use-case. You should just do your due diligence and evaluate the reason why one would fit you more than the other, and reevaluate it from time to time depending on the changes in your environment.

This whole "cloud bad" is just childish.

ownagefool · 2 years ago
> A lot of org move to cloud based hosting because it enable them to go way further in FinOps / cost control

I think a lot of orgs move to cloud simply because it's popular and gartner told them so.

But taking a step away from that, it's really about self-service. When the alternative is logging a ticket for someone to manually misconfigure a VM and then fail to send you the login credentials, then your delivery is slow.

When you're chasing revenue, going slow means you're leaving money on the table. When you're a big bureaucratic org, it means your middle managers can't claim to have delivered a whole bunch of shit. Nobody likes being held up, but that's what infrastructure teams historically do.

andrewstuart · 2 years ago
>> This whole "cloud bad" is just childish.

Not childish…. it’s a growing line of thought in the IT community that has bought the cloud sell unquestioningly for 20 years.

calvinmorrison · 2 years ago
The cloud is better and worse than bare metal. It depends on the use case.

AWS is Kafkaesque though

whstl · 2 years ago
There is a massive difference between "[if X happens] consider dropping the cloud" and "cloud bad".
Jean-Papoulos · 2 years ago
>Seriously, if you’re at the point that you’re doing sophisticated analysis of cloud costs, consider dropping the cloud.

The blog post's solution is relatively simple to put in place ; if you're already locked-in to AWS, dropping it will cost quite a lot and this might be a great middle ground in some cases.

antonvs · 2 years ago
> Host it yourself.

If you're actually using the features of cloud - i.e. managed services - then this involves building out an IT department with skills that many companies just don't have. And the cost of that will easily negate or exceed any savings, in many cases.

That's a big reason that the choice of cloud became such a no brainer for companies.

sgarland · 2 years ago
Next you’ll tell me that full-stack is a lie, and devs don’t actually know how to run a DB.
crabbone · 2 years ago
I don't think "host yourself" in this instance would've helped. I think AWS in this instance is operating at a loss. Author found a loophole in AWS pricing and that's why it's so cheap. Doing it on their own would've been more expensive.

Now as to why the AWS pricing the way it is... we may only guess, but likely to promote one service over the other.

amluto · 2 years ago
AWS is surely operating at a loss for this particular case (zero S3 charge).

But there is no way that cross-AZ traffic costs AWS anywhere near what they charge for it.

belter · 2 years ago
Those VPS hosting services are a solution for a startup but not to run your internet banking, airline company or public sas product. Plus their infinite egress bandwidth and data transfer claims are only true, as long as you don't...Use infinite egress bandwidth and data transfer....
api · 2 years ago
There are also many bare metal and VPS providers that charge radically less for bandwidth or even charge by size of pipe rather than transfer.

Cloud bandwidth pricing is… well the best analogies are very inappropriate for this site.

cdchn · 2 years ago
Which VPS services don't charge you at all for bandwidth?
dijit · 2 years ago
you'd be harder pressed finding ones that do (before a reasonable limit).

tilaa.com

vultr.com

hetzner.com

linode.com

champtar · 2 years ago
OVH (except for APAC data centers), I think Scaleway also has bandwidth included.
frankjr · 2 years ago
mciancia · 2 years ago
Turing_Machine · 2 years ago
The tipping point for self-hosting would be the point at which paying for full-time, 24/7 on-call sysadmins (salary + benefits) is less than your cloud hosting bill.

That's just not gonna happen for a lot of services.

lijok · 2 years ago
This makes no sense.

So what do I do if I'm at the point where I'm doing sophisticated analysis of on-prem costs? Do I move to the cloud?

barkingcat · 2 years ago
also, if you really need to transfer hundreds of TB's of data from South Africa to the US, put it on a palette of disks and send it via bulk shipping.

then load the data into the datacentre and then just pay for the last sync / delta.

Dead Comment

jonatron · 2 years ago
If you're a heavy bandwidth user it's worth looking at Leaseweb, PhoenixNAP, Hetzner, OVH, and others who have ridiculously cheaper bandwidth pricing.

I remember a bizarre situation where the AWS sales guys wouldn't budge on bandwidth pricing even though the company wouldn't be viable at the standard prices.

declan_roberts · 2 years ago
That’s very unusual, I think. Transfer cost seem to be something most people can negotiate.
jonatron · 2 years ago
I hadn't really thought about it much, but googling it looks like there's a discount programme for a committed spend of around $1M/year. For a small company, that's a lot of money, and it was an unusually large amount of bandwidth for the size of company. I suppose it makes sense now I know they're interested in companies spending that sort of money.