framedsc / HallOfFramed

Hall-of-framed website which contains various galleries with screenshots made by the members of the community
Creative Commons Zero v1.0 Universal
6 stars 4 forks source link

Compressing shots for the migration #26

Closed originalnicodr closed 11 months ago

originalnicodr commented 11 months ago

Following a backup oduska made some years ago, in August 2021 the HOF had 2046 entries and weighted around 18.5GB.

By extrapolating, we could say with a good amount of confidence that, with the current 5490 entries, the HOF would weigh around 49.64 GB.

And by extrapolating into the future, we can say that we get around 1524 shots a year, which following oduska numbers would mean around 13.8GB more each year. Therefore, I believe it would be impracticable in the long run.

@etra0 ran the numbers better and he got a whooping average of 17.2 gb/year, so yeah not looking great.

My suggestion is to compress images using mozjpeg. I have been personally using it for my own site and it has averaged half of what the original png weights.

Even so, it can still get big really quick, so maybe resizing the shots as well would be a good idea.

BUT I would argue about only doing that in the future when we are running low on space, since maybe by that time storage becomes cheaper, or newer compression algorithms come up which helps us save more space (altho I wouldn't expect miracles compared to what we can accomplish with mozjpeg).

If we decide that we should resize the images, we could explore the possibility of still getting the full-size image link by requesting discord the original image link, as explained in #29

Take in mind that, if we do this, it might increase the processing costs since it would involve converting every image. For reference, making thumbnails has not cost us much CPU-wise these past few years. Altho I would compress them locally for the first upload of all of the past HOF images, to avoid that spike in cost at the beginning.

Blocked by

originalnicodr commented 11 months ago

Maybe we can use this if we end up using mozilla jpg compression.

originalnicodr commented 11 months ago

Since we will be paying 6usd a month per 1TB of storage space we don't need to compress any of the shots. However, if something changes in the future we might need to reevaluate our options.