AWS S3: Why sometimes you should press the $100k button
https://www.cyclic.sh/posts/aws-s3-why-sometimes-you-should-press-the-100k-dollar-button
AWS S3: Why sometimes you should press the $100k button
https://www.cyclic.sh/posts/aws-s3-why-sometimes-you-should-press-the-100k-dollar-button
this gave me anxiety
It lost me at “s3 block storage”
The whole performance in prefixes thing is about 5 years out of date and rather inapplicable these days.
Did a bench test of it last summer together with an AWS pro services architect, was definitely still a thing at least then.
We ran Athena load partition queries (tried both engine v1 and v2) while at the same time tried to scan those files with lambda.
Turned on extra metrics for a couple hours (a few thousand dollars for that experiment) and saw a non-zero error rate from Athena hogging prefix read.
The problem is burst load. AWS will over time optimize the partitioning based on usage. Athena queries on big data aren’t a common access pattern for some buckets and the indexing cant immediately respond. Dangerous when both the prod application and analytics are using data from the same place
I pushed the $100k button by accident once. Thankfully it was only a $2.5k button for me, but it still made me shit my heart out. The worst mistake I’ve done on AWS so far.
Why? Object based may be more widely used, but if you’re on EMR you need something hdfs like.
Guess I’ll just use Postgres
Performance in prefixes still exists, it’s documented in the design guide for performance. What changed is the level of entropy you needed between prefixes for them to get partitioned— if you’re still using high-entropy random keys, you still get the performance benefit that can now be achieved with lower entropy keys
I feel ripped off because I read the whole thing, but didn’t understand “the truth” conclusion.
We hit s3 prefix rate limits just last week. What’s out of date and inapplicable about them?
Soo… what’s the optimum initial setup for this project?
Separate buckets for each log type? (Login and logout buckets?)
Group days/weeks into gzip files?
Lifecycle plans from the beginning?
Still using the date prefixes?
My TL;DR: They did not plan the architecture correctly for a big data bucket because many startups don’t. When files accumulated to be too expesive, they spent (wasted) a bunch of time not understanding how prefixes and pricing worked for S3 LifeCycle policies to clean up a Bucket with billions of small files. In the end, the resorted to using a big SageMaker instance to crawl the bucket and delete files one by one.
I can agree to say I don’t know why they chose SageMaker and maybe they should elaborate on their reasoning.
My understanding is:
Inheriting a shitshow? Chip away at it incrementally.
Whoops, I forgot about tags! Good call.
I interpreted the very ending a little differently -
Whether or not the org is still paying that bill has been lost to history but legend says that user story got de-prioritized.
Because it was too late to “just push the button”, which is what the should have done, a dumb story was added to the sprint and then deprioritized into the backlog after wasting a ton of time and money. Had he just pressed the button to begin with, the issue would have largely resolved itself and saved more than $100k
Prior to 2018, you had to be careful to avoid hitting hard performance caused by having too many busy objects under the same prefix which could be a problem if you were using a logical layout based on some kind of metadata which made sense for your app and, say, customer/B/ had millions of objects but customer/A/ and customer/C/ had hundreds. People would do schemes like prefixing objects with content hashes (e.g. if the object’s hash was 1234567890abcdef you might have uploaded it as 12/34/45/1234567890abcdef something similar) which ensured that the objects were evenly distributed but at the cost of requiring you to maintain an index somehow.
In 2018, AWS announced a significant improvement which allowed many people to stop caring about that:
This S3 request rate performance increase removes any previous guidance to randomize object prefixes to achieve faster performance. That means you can now use logical or sequential naming patterns in S3 object naming without any performance implications.
The catch is that while S3 will now automatically repartition the data it’s not perfect or instantaneous so you can still hit problems if your access patterns change quickly or you dump a ton of data all at once. u/doitdoitdoit’s comment provides one example of how that can happen. If you hit this and your application has decent retry capabilities it may not matter; otherwise you might want to avoid suddenly putting something into production without warmup time or talk with your TAM about some of the optimizations the S3 team can do to help you prepare for that new load.
I’d also add: “consider whether it might be faster to eat a big one time cost rather than spend months rearranging deck chairs” — if there isn’t an easy way out, sometimes it’s better to get to clean quickly if you can afford it.
Maybe read the whole thing.
OK, turns out SageMaker is an ML service in AWS. Who knows what it does, specifically?
But I can’t see why anything ML-related is needed here. You’ve got a bunch of object, and you want to delete most of them. Write a script and delete them – even if there are billions, you grind through it and try to sort out scale. What’s the application of ML here?
That whole blog post was written by someone who wants to be cute rather than informative, so the signal-to-noise ratio is low throughout. It craters at the end, when it’s all ambiguous noise and no signal.
I demand a refund.
If this were me, I guess I’d separate and abandon. That is, I’d get whatever it was that was writing and reading these objects to go somewhere else, with new schemes for naming and bucketing and partitioning based on what we just learned.
Then, I’d either just completely abandon the old buckets (delete in one fell swoop), or crawl over them as time went on to delete, migrate, zip, compress, or whatever solution we decided we needed. This way, the new way of doing things isn’t interrupted and we rip the band-aid off. We aren’t making the problem worse. And we’ve isolated the horrible situation. We can completely obliterate it, or we can paw through it and recover as fast as we would like to – or can afford to.
And, sure: the big expensive transition is still worth considering. It’s got to be weighed out for cost and time and whatever other considerations we have pressuring the decision.