s3 and tiering question

we have a bucket that has ~700mil files that take up ~150T of space, small files, 5K to 5M(don’t ask). all in standard tier (tech debt) and it cost us pretty penny. ~$4k per month.

SO we decided to move things to infrequent access and glacier instant retrieval. lifecycle policies wewre made to only move files bigger then 128K and older then 30 days to IA and older then 180days to glacier instant retrieval.

We didn’t check the fine print and the glorious cost od $0.02 and $0.01 per 1000 objects hit us in the face. ~$2k the first day and $2k second day. so we decided to disable policies. Next day, sweaty palms, but we saw 121T moved to glacier IR and 20T moved to IA. noice price drop from ~$4k to $1k by the looks of it. I checked again now and hourly rate is steady BUT now we only have 76T in IR and 13T in IA. meaning we’ll still pay ~$2k per month.

what i want to ask is - is this normal? would that mean that someone is actually accessing old files so they are bing moved to standard s3? what would be the best way to check that? access logs and shit are pretty damn bad when you have 700mil files.

any reccomondation would be greatly appriciated!

Or maybe we just saw the would-be state if we left the lifecycle run? I don’t think aws would move shit back if life cycle rules were disabled?

Life Cycle only affect new object that got created after lifecycle rule is in place so change it lifecycle rule should not take affect on any existing objects unless you copy and overwrite them files

Did you only disable the downward lifecycle rules but not upward? That’s how you’ll get less data in IR/IA after a day.
Or was it intelligent tiering?

Anyways, someone poked the files in IR/IA so now they’re back in standard.

A one-time 4K spend on IO is worth it because you’ll recoup it in 2-3 months. Why get wet feet about that?

access logs and shit are pretty damn bad when you have 700mil files.

Then you’d need to put the logs through Athena (or other analytics) and start parsing/correlating events.

This is

. We’ve put in lifecycle rules the other day and stuff moved into Glacier almost immediately.

Weird. I put lifecycle policy to move everything to glacier in 1 day. None got move after a week, led me to believe it doesnt effect existimg objects

transition to glacier can only happen on objects older than 30 days. You can directly put into glacier from the get go instead.

we don’t really have any upward lifecycle rules. there are only 2 rules as i said - move larger then 128k and older then 30 days to IA, move larger then 128k and older then 180 days to IR.This is how bucket looks right now Imgur: The magic of the Internet

I was thinkking maybe to run it again and leave it on but since there is 700mil files prices could be up to $14k which is pretty bad. th there would be savings but still.

so files can go back to standard if they are aceesed frequently? we don’t have inteligeht tiering enabled there

we don’t really have any upward lifecycle rules. there are only 2 rules as i said - move larger then 128k and older then 30 days to IA, move larger then 128k and older then 180 days to IR.
This is how bucket looks right now

I was thinkking maybe to run it again and leave it on but since there is 700mil files prices could be up to $14k which is pretty bad. th there would be savings but still.
so files can go back to standard if they are aceesed frequently? we don’t have inteligeht tiering enabled there

TLDR: You have dynamic data and unknown access patterns. Use intelligent tiering where practical.

If you are just going to mimic the intelligent tiering storage class with lifecycle policies, you will be much better off actually using the intelligent tiering storage class.

The reason being the cost reduction for transitions between tiers, and lack of a painful data retrieval fee (except expedited on archives).

You also don’t understand your data access patterns … which is what intelligent tiering manages for you.

Lifecycle policies are best used when you have relatively static data that has a very well defined access pattern, e.g. backups, database snapshots, daily / weekly / monthly / quarterly / annual logs and reports, etc. For a versioned bucket, a lifecycle policy is also useful for removing erased objects and erase markers after a period of time (i.e. emptying the “recycle bin”).

You can probably drill down into your data with Cloudtrail reports if you really wanted to, but that might not reveal anything useful unless you are looking from something specific, like accces by user or prefix.

oh i just found out that if i go with inteligent tiering it will cost us 0.01 per 10k files to move to IT and it will add cost of 0.0025 per 1k objects BUT then moving between tiers is free, right? I’m looking in saving some money because this is public bucket where we shot ourselves in te foot and promissed free/unlimited always and we’re getting fucked by it(180k objects being stored there per day)

You mostly save on transition and data retrieval fees.

https://aws.amazon.com/s3/pricing/

You don’t have to move it all at once either.

It will take a month before stuff transitions, so you might want start with some stuff that is already in standard.


You can change the bucket’s default storage class to intelligent, for new objects. No transition cost here!

You can configure S3 Intelligent-Tiering as your default storage class for newly created data. You can also choose to activate one or both of the archive access tiers by using the PutBucketIntelligentTieringConfiguration API operation, the AWS CLI, or the Amazon S3 console

https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html


You do have to enable archive if you want that. See the tutorial:

https://aws.amazon.com/getting-started/hands-on/getting-started-using-amazon-s3-intelligent-tiering/


Make sure your lifecycle polices don’t muck it up by transitioning out of intelligent.


There are no retrieval charges in S3 Intelligent-Tiering. If an object in the Infrequent Access tier or Archive Instant Access tier is accessed later, it is automatically moved back to the Frequent Access tier. Downloading or copying an object through the AWS Management Console or running GetObject or CopyObject will initiate access. Running a HEAD, LIST, GET object tags, or PUT object tags operation will not constitute access.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html

Bumping 'cause I edited my previous message too many times, and I don’t want you to miss the hopefully useful additional info :smiley:

Oh man. Someone at my work tried to do this to a bucket to save some money. They blew 180k in transfer fees. I was like so much for money savings

Objects don’t go back to standard if you’re not on Intelligent Tiering, [edit]: No such things as upwards rules.

As for why objects would get back from cheaper tiers into standard, without access logs, you’re just gonna have to ask your co-workers. Maybe a well-intending but ill-informed person thinks they can “undo” the action to reduce costs, not realizing they’re incurring extra cost with an extraneous action.