293

Hey yall, just wanted to chime in with a quick update on why we were down and have gone down a few times these past few days.

So... for those who don't know a bit on the backend way of how lemmy works right now, it's a lil more than a mess. Lemmy itself uses very little computing resources, you could probably run a decent instance on a toaster (I wouldn't suggest it though) but the problem that arises rapidly is the way photos are managed. The photo database downloads images both that are uploaded and federated. There is an option to disable caching for federated NSFW posts by unchecking enable NSFW within the instance admin panel. That's the only option related disabling federated images as of right now.

You see where I'm going with this, with this instance being as large as it is? Our photo database has been filling up pretty rapidly. We are attempting to troubleshoot solutions to prevent caching all federated content. Unfortunately as our backend team is attempting to figure that out, our pictures database just keeps ballooning more and more.

We have deleted some stuff in hopes to give more time, but we unfortunately have no choice but to migrate to object storage ASAP. Tomorrow there will likely be downtime as we migrate things over, and unfortunately there is no telling how long that will take.

Thank you for being patient and understanding while we navigate this. If you want to see updates to our status when we go down, check out our mastodon page here or come to our matrix public operations channel for updates (link in the sidebar.)

Things should work today though. Emphasis on should.

We are working on open collective still, but hosting this instance does cost money. If you are able to, donations are greatly appreciated. Especially as we will have to factor in object storage into our costs now.

all 50 comments
sorted by: hot top controversial new old
[-] monkofapathy@lemmynsfw.com 63 points 1 year ago

Yeahhhhh you don’t want to store images in a database. That will kill the database in a hurry. Store references to object storage.

[-] gavi@lemmynsfw.com 41 points 1 year ago

It's ironic cause object storage for pictrs is a relatively new feature

[-] ramble81@lemmynsfw.com 17 points 1 year ago

MSSQL has had blob storage for a while and I don't know anyone that uses it. Their Filestream stuff was interesting by letting you store it in the FS but be indexes via the DB, but come-on, use a damn pointer people.

[-] harder@pornlemmy.com 1 points 1 year ago

My company stores some 80+ TB in a series of MSSQL databases. Yes, you read that right. In. Each DB is allowed to grow to 250GB, then a new one is created and written to while the old one becomes read only.

[-] wankbank@lemmynsfw.com 2 points 1 year ago

That is horrific. In my day job, I stored images in a database in my first job, learnt my lesson and now have an allergic reaction just thinking about it.

[-] monkofapathy@lemmynsfw.com 8 points 1 year ago

Thanks for your hard work by the way.

[-] monkofapathy@lemmynsfw.com 6 points 1 year ago

That is interesting. Oh well, I’ve met developers who didn’t always make the best design decisions for the backend until their ass has had chunks removed.

You haven't clarified yet as to whether or not you were storing the actual image data in the database....

[-] gavi@lemmynsfw.com 2 points 1 year ago

That’s how Lemmy does so by default. I wish I was kidding 🙃

I'm not sure how it still surprises me that someone could be THAT stupid. Yes it's called a "data"base, but it's for storing meta data, and short text data, not images/video/PDFs. Fucking carpenters always using a hammer for any job and plumber using a crescent as a hammer. Insane.

[-] Anafabula@discuss.tchncs.de 1 points 1 year ago

Lemmy uses pict-rs for image storage, which can store on the filesystem or object storage (filesystem is the default) and Lemmy's default config doesn't seem to change that

[-] BlameThePeacock@lemmy.ca 30 points 1 year ago

Just remove direct uploaded pictures, there are a number of image hosting sites that already exist that are both setup for this kind of thing and that people already use and link to.

This is already the case for videos for the very same reason.

[-] zabadoh@lemmynsfw.com 36 points 1 year ago

The problem with a 3rd party hosting site is that there's no guarantee they suddenly won't go out of business, or hide or delete all their nsfw content like imgur and Tumblr and many others in the past.

Just hosting images for another site like this one isn't profitable because they can't sell ads for the hotlinked images served to users of that other site.

It is a conundrum to find a working long term solution.

[-] rustling_leaves@lemmynsfw.com 16 points 1 year ago* (last edited 1 year ago)

One of the worst things when it comes to porn is videos or pictures being deleted. Especially frustrating to browse old forums and none of the download links work or none of the images show. Or when pornhub deleted nearly 80% of their videos. There are videos out there which I am still looking for. Probably will never find again. Partly the reason I am a hoarder.

[-] zabadoh@lemmynsfw.com 9 points 1 year ago

I completely agree.

The models retire, the photographer or rigger retire, or shut down because of piracy.

Torrents and download links disappearing.

Fuck pornhub for multiple reasons.

It's such a shame.

Support the artists while you can, because that's what they are, and preserve their works for posterity.

[-] LexiconBexicon@lemmynsfw.com 3 points 1 year ago

Yeah that was such a heartbreak, like over half the website just disappeared over false allegations and so much really popular amateur content gone forever was deleted for no reason in the purge.

[-] BlameThePeacock@lemmy.ca 11 points 1 year ago

It really isn't a problem when we're talking about these kinds of images. This isn't a type of content that if it disappears in 12 months anybody is going to feel great loss for. It's not instructions on how to maintain some esoteric computer system, or some sort of critical cultural records. It's a transient commodity, with a steady stream being generated all the time. Nobody is going back and browsing the stuff that was posted 5 years ago.

Anyone who wants to keep such images for extended periods is able to save them locally to their computer as they get posted.

[-] Dark_Blade@lemmy.world 15 points 1 year ago

You underestimate the average porn addict. People were downloading years of porn they’d ‘saved’ on Reddit while making their escape.

[-] BlameThePeacock@lemmy.ca 6 points 1 year ago

The save option is still there.

Also, This lemmy instance is actually more likely to fail right now than most of these established image sharing sites.

[-] Blamemeta@lemmy.world 0 points 1 year ago

I did that. I have like 5 comics from when imgur started deleting porn.

[-] AnAccount@lemmynsfw.com 4 points 1 year ago

The only real solution is to pay to host images. Nobody will accept though so we end up with the issues you describe.

[-] Innocent_Bystander@lemmynsfw.com 14 points 1 year ago

Please tell me you're not putting the images actually /IN/ the database? Images/files don't belong in the fucking database(we have had customers try to do this and it's the biggest headache to get fixed). You only put LINKS to files in the database.

[-] MikeyMongol@lemmynsfw.com 23 points 1 year ago
[-] beigeoat@lemmy.zip 2 points 1 year ago* (last edited 1 year ago)

I am using object storage on my personal instance, migration should also be relatively simple, pictrs has good documentation.

[-] db0@lemmy.dbzer0.com 9 points 1 year ago

They do not. They just didn't phrase it right

[-] baconboy@lemmynsfw.com 3 points 1 year ago

Other comments seems to suggest otherwise.

[-] db0@lemmy.dbzer0.com 0 points 1 year ago* (last edited 1 year ago)

I am literally hosting one of the biggest lemmy instances and I've been where they are before.I know what I'm talking about

[-] baconboy@lemmynsfw.com 8 points 1 year ago

Then educate us instead of boasting and being negative…

Sharing knowledge > sharing opinions

[-] Anafabula@discuss.tchncs.de 2 points 1 year ago

Lemmy uses pict-rs for image storage, which can store on the filesystem or object storage (filesystem is the default).
Lemmy's default config

[-] altima_neo@lemmy.zip 9 points 1 year ago

Do what needs to be done, boss! We'll be here waiting for you.

[-] hohoho@lemmy.world 9 points 1 year ago

Oooh neat! Which object storage are you guys using? Ceph? MinIO? Something else? Would love to discuss gory details!

[-] BoastfulDaedra@lemmynsfw.com 8 points 1 year ago

Hey, you do what you gotta do.

Thank you.

[-] wankbank@lemmynsfw.com 7 points 1 year ago

I can't believe you're only just moving to object storage! Offload that stuff as much as possible (this is probably a grandmother suck eggs situation, I know).

When you say "photo database", do you mean Lemmy literally stores the binary image files in the db, or just the storage area for images (ofc linked to from the db)?

[-] gavi@lemmynsfw.com 6 points 1 year ago

By default lemmy as a software, the whole photo database is stored directly into a file folder that links itself to the drive. The entire photos. And of course the drive just rapidly inflates like a balloon since it stores not just local images but federated images

[-] db0@lemmy.dbzer0.com 6 points 1 year ago* (last edited 1 year ago)

Note if you're migrating pictrs you don't need a whole lemmy downtime. Just pictrs

[-] yay@lemmynsfw.com 2 points 1 year ago

Thx I'll try to do that way.

[-] db0@lemmy.dbzer0.com 2 points 1 year ago

Also it will be way more time than you think. The migration is slooooooow.

[-] yay@lemmynsfw.com 3 points 1 year ago

25GB in 4 hours. Looks like it will take a few days 😕 I asked it to the Matrix chat, hopefully they have a solution.

[-] NatoBoram@lemm.ee 6 points 1 year ago

It would be interesting if hosting images via IPFS was an option, but that would require pretty heavy changes on Lemmy's side.

[-] gfxkultur@lemmynsfw.com 5 points 1 year ago

You might want to look at storj.io for object storage. We've been using it in production at work and are really satisfied. It's priced pretty well, highly available, high throughput, multi regional by default and s3 compatible.

[-] DelvianSeek@lemmynsfw.com 5 points 1 year ago

Thanks for the update and the openness. Hope you are able to make it work with a minimum of fuss, and that all the users understand. Good luck!

this post was submitted on 02 Aug 2023
293 points (98.7% liked)

Lemmy NSFW

11711 readers
4 users here now

Updates about lemmynsfw.com

founded 1 year ago
MODERATORS