this post was submitted on 11 Jul 2023
167 points (98.8% liked)
Lemmy
12548 readers
5 users here now
Everything about Lemmy; bugs, gripes, praises, and advocacy.
For discussion about the lemmy.ml instance, go to [email protected].
founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Pictrs 0.4 recently added support for object storage. This is fantastic, because object storage is dirt cheap compared to traditional block storage (like a VM filesystem). This helps a lot for image storage, which is a large part of the problem, but it's not the whole problem.
I know Lemmy uses Postgres for everything else, but they should really invest time into moving towards something more sustainable for long term/permanent hosting. Paid Postgres services are obscenely upcharged and prohibitively expensive, so that's not an option.
I'm armchair architecting here so I'm not sure what that would look like for Lemmy (Cloudflare KV? Redis?)
Still, even my own private instance has been growing at a rate of about 700MB per day, and I don't even subscribe to that many things. I can't imagine what the major instances are dealing with. This isn't sustainable unless we want to start purging old data, which will kill Lemmy long term.
EDIT: Turns out ~90% of my Lemmy data is just for debugging and not needed:
https://github.com/LemmyNet/lemmy/issues/3103#issuecomment-1631643416
The largest table holds data that is only needed by Lemmy briefly. There is a scheduled job to clear it... Every 6 months. There are active discussions on how best to handle this.
On my instance I've set a cronjob to delete everything but the most recent 100k rows of that table every hour.
I saw that issue, and then I saw people having problems after clearing it, so I'm just going to wait until they figure that out in a stable version. Looking forward to it though!
@[email protected] @[email protected] Can either of you link to that discussion please?
It looks like the issue I was referring to has since been edited, as it's not actually relevant to clearing this database bloat:
https://github.com/LemmyNet/lemmy/issues/3103
I mean, that post is exactly about clearing database bloat. The bulk of the bloat is in the activity table (going by the comments in the thread).
Yeah, I meant the comments that have been hidden previously made it seem like clearing it would be an issue, so I hesitated to clear it. Now that those comments have been edited, it looks like it won't break anything after all.
Gotcha. Thanks for pointing me in that direction. Seems like that table's only useful for debugging federation issues. Not sure why they'd want to keep it for 6 months.
It seems like lots of design choices were made with pre-Reddit-exodus usage in mind 😅
That's for sure. Hopefully they can pivot and start thinking about how to scale better. On one hand I don't envy the developers but it's gotta be kind exciting.