this post was submitted on 30 Jun 2023
36 points (97.4% liked)

Selfhosted

40394 readers
205 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi, I'm new with self-hosting but managed to set up my own Lemmy and Mastodon instances on a VPS recently. However, I ran into an issue with disk space quite rapidly (which I had way too few, because I started with the cheapest, smallest package for my VPS).

Now I prepare a new setup, where I'll be able to dynamically scale disk space as needed, but this can get expensive quickly. Therefor my question: How much disk space do I typically need for private (1-3 user) instances of Lemmy and Mastodon? Are there settings, where I can limit the disk space utilization (at the cost of older stored content being overwritten)?

I would be fine with needing up to like 30-40 GB, but any more than that would be getting kinda expensive ....

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

I can't help with Lemmy, but I've been running a single-user Mastodon instance for almost a year now.

Like you, I found that the media very quickly used up much more disk space than I anticipated. There are a few things you can do.

You can tune how long media is stored for: some of this is done in the admin interface, but really you need to set up cron jobs to regularly run various tootctl commands. This is the crontab I use:

SHELL=/bin/bash
PATH=/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/bin:/usr/local/bin:/usr/bin:/bin

RAILS_ENV=production
# Remove media attachments older than 8 days
11  19  *   *   *     cd /home/mastodon/live && time bin/tootctl media remove --days 8
# Remove link previews older than 28 days
22  5   *   *   *     cd /home/mastodon/live && time bin/tootctl preview_cards remove --days 28
# Remove files not linked to any post
 3  23  *   *   0     cd /home/mastodon/live && time bin/tootctl media remove-orphans
# Prune remote accounts that never interacted with a local user
44  1   *   *   *     cd /home/mastodon/live && time bin/tootctl accounts prune

You can of course choose even stricter settings but I found that no matter what I did, given that I am following approx 1,000 other Fediverse accounts it still used up more disk space than I was comfortable with.

So I offloaded most of the media storage onto an S3-compatible service. It's breaking the self-hosting ethos somewhat, but with Backblaze B2 I can happily store and serve several hundred GB of media files for just a couple of dollars a month. To me, that was a no-brainer.