this post was submitted on 19 Nov 2023
300 points (98.4% liked)

Fediverse

28395 readers
869 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS
 

Hi everybody! I rent a vps with 6 cores, 16 GB ram and 100 GB nvme to run fediverse instances (mastodon, lemmy, matrix, peertube) and a couple related services (nginx proxy manager, nodebb forum, wiki.js, uptime kuma, portainer, tig-stack).

The why

Over the past month they have been running. It has been some work to set them up but since then they run pretty flawlessly. My main goal was to find out how much hardware I really need to run private instances (just me or maybe a handful of friends).

Here are the stats:

Disclaimer: I checked and all services federate correctly.

Resource usage

From my point of view, the 6 cores are totally overkill. A two core would probably suffice. Of the 16 GB of ram I currently need 4. So 8 should suffice. The 100 GB nvme drive is barely handling it (66% full) and thats without backups (they get pulled immediately and then deleted) and with a 48 hour media delete cycle on mastodon (which currently is the largest folder I have).

Individual Space usage (nvme)

  • 8.0K heimdall
  • 2.0G lemmy
  • 7.1G mastodon
  • 5.2G matrix
  • 123M nodebb
  • 236M npm
  • 3.5G peertube
  • 12K pgadmin
  • 8.0K portainer
  • 376K tig-stack
  • 8.0K uptime-kuma
  • 8.0K watchtower
  • 12K wiki.js
  • 3.6G wordpress

So while I use lemmy the most, mastodon uses far more disk space, matrix also uses more than lemmy although I'm in like 20 chats and my friends don't use matrix except to chat with one another. I have subscribed to maybe 50 communities on lemmy.

Since the graphs in the screenshots lack legends, I'll explain the spikes.

Container CPU usage

  • red spike: lemmy postgres
  • lightblue: mastodon sidekiq
  • yellow: telegraf
  • dark-blue: lemmy ui

Container Ram usage

  • red line: peertube
  • light-blue: mastodon sidekiq
  • dark-red: lemmy postgres
  • pink: mastodon postgres

Summary

So far I didn't actively try to get the needed resources down except mastodon since I didnt want it to derail my experiment.

Mastodon seems to have the worst data on drive footprint, Peertube seems like a constant ram hog and lemmy spikes in the cpu all the time. So they all have their positives and negatives but nothing major. If you have 2 cores, at least 6 GB of ram and probably 250 GB of disk space to spare you should be good.

I'll work on making the compose files and config files publicly available but right now I'm not there. If you need help spinning up an instance, please let me know. I can send you individual files if needed.

Have a good one! :)

top 32 comments
sorted by: hot top controversial new old
[–] fmstrat@lemmy.nowsci.com 62 points 1 year ago* (last edited 1 year ago)

Hey all, don't get too excited. A 2GB Lemmy instance has very little data going through it. My instance, which is just me, and auto-subscribes to communities with "Top" posts using LCS, processes about 10GB of new data a day.

Without subscriptions, the Top, Hot, etc feeds would basically be empty. So if you only want communities you subscribe to, IO will be low, but if you want a full experience, disk and IO will be your bottleneck.

All that being said, thanks to OP for giving the community all this extremely helpful info.

[–] Docus@lemmy.world 35 points 1 year ago (2 children)

Thank you for sharing that. Personally, I am unlikely to start my own hosting, but hopefully it helps others to make the fediverse stronger

[–] Rocketpoweredgorilla@lemmy.ca 11 points 1 year ago (1 children)

I've been wanting to, but I'm lazy and have adhd. I should easily have the hardware requirements strewn around the house though to slap something together should my focus travel that road.

It's nice to know your options.

[–] schmorpel@slrpnk.net 9 points 1 year ago* (last edited 1 year ago)

ADHD

should my focus travel that road

made me snort.

Also, thanks OP for this post, this is some great quality dense information useful stuff right here.

[–] haui_lemmy@lemmy.giftedmc.com 9 points 1 year ago (1 children)

Thank you for your feedback. Thats precisely my intention with this post. I‘d like hosting your own instance to be as easy as „come up with name, buy domain name, run script, done“. Lot of work until that day but it would make the fediverse infonitely larger imo.

[–] padge@lemmy.zip 2 points 1 year ago (1 children)

I'd like to spin up a Matrix instance for me and my friends on my NAS, but like you said it's currently more involved than just getting a domain and running a compose. The space is evolving fast though and experiments like these help a lot

[–] haui_lemmy@lemmy.giftedmc.com 3 points 1 year ago

Sounds like a great idea. There are companies that host servers like these. Could be a nice stepping stone. Away from big tech but not quite self reliant. Biggest problem is always data loss which is less of a problem if someone gets paid for hosting.

[–] BASTAHT@feddit.nl 12 points 1 year ago (3 children)

Interesting read! Can I ask how much running this approximately costs?

[–] subtext@lemmy.world 17 points 1 year ago (1 children)

Looking at DigitalOcean, a similar ish Droplet would be around $100/mo.

At Hetzner, a similar ish shared host would be around €30–40/mo, or dedicated for €50–60/mo.

Not sure where OP is hosting, but they may have gotten cheaper.

On Hetzner, if you go with OP’s recommendation of 2 vCPU, 8 GB of RAM, and do the storage add on for 100 GB of bulk storage, it’d be about €16/mo.

[–] fry@fry.gs 5 points 1 year ago

Some offer very low prices, HostHatch is one example. I’ve been using RamNode for years and while they’re a little more average for pricing, I’ve had no issues. Never used HostHatch, so maybe someone who has used it can comment on the quality of service.

[–] haui_lemmy@lemmy.giftedmc.com 8 points 1 year ago (1 children)

I pay around 10$ per month atm. But you need to factor in backups which I handle with my home server. Those can be acquired as cheap as 2$ a month I believe. It’s not expensive if you know where to look and dont mind making mistakes.

[–] daylin@lemmy.dayl.in 5 points 1 year ago (1 children)

That's way less than what I pay to vultr for a less powerful VPS to host my own set of services (lemmy, gotosocial, gitea). I gotta find a cheaper host 🙃.

[–] haui_lemmy@lemmy.giftedmc.com 8 points 1 year ago

Check out https://serverhunter.com. They’re good. But keep an eye on backups.

[–] lobsticle@lemmy.world 4 points 1 year ago (1 children)

I am also interested in the answer to this and which service the author is using.

[–] haui_lemmy@lemmy.giftedmc.com 6 points 1 year ago

I think I found them on serverhunter.com or similar. Just search for serverhunter and you should find many interesting offers. The important part is that a good backup procedure is more important than strong hardware.

[–] amju_wolf@pawb.social 12 points 1 year ago (2 children)

Anyone knows why Mastodon is so disk space hungry? Seems kinda stupid.

[–] Fuck_u_spez_@sh.itjust.works 8 points 1 year ago

Is it all the video?

[–] tofuwabohu@slrpnk.net 3 points 1 year ago

Every image on the federated timeline. It's a lot if users on your instance follow many other users.

[–] xtremeownage@lemmyonline.com 11 points 1 year ago (2 children)

I'd say, you have a small instance.

I used to host lemmyonline.com, which has somewhere around 50-100 users.

It was upwards of 50-80g of disk space, and it used a pretty good chunk of bandwidth. CPU/Memory requirements were not very high though.

[–] haui_lemmy@lemmy.giftedmc.com 4 points 1 year ago

As I said, I host a small instance for me and a handful of friends. I subscribed to 30-50 communities and post regularly. I don’t think thats in any way comparable to a 50-100 people instance.

Also, my findings were that mastodon has like 2-3 times the storage requirement although the same numbers of users.

[–] Deebster@programming.dev 1 points 1 year ago (1 children)

"Used to"? It still seems to be online, or do you mean that the other admin handles the hosting now?

[–] xtremeownage@lemmyonline.com 3 points 1 year ago

The other admin now "owns" this instance, and hosts it in the EU.

I am just a glorified moderator now.

[–] Sibbo@sopuli.xyz 9 points 1 year ago

I hosted mastodon once. 20GB disk was full after a few days only. At some point the full disk somehow made the postgres DB delete itself, and then I stopped running my own instance.

For Lemmy, the CPU spikes are probably the score updates...

[–] Lugh@futurology.today 7 points 1 year ago* (last edited 1 year ago) (2 children)

Great info. Out of curiosity what does your hosting setup say about visitor numbers? Futurology.today uses Cloudflare. They give a figure of about 10k per day for what they call unique visitors. That seems unduly high when you look at how busy our lemmy instance actually is. We have just short of 1K subscribers, so I would assume visitor numbers would be lower than 10k per day.

[–] billygoat@catata.fish 3 points 1 year ago

The cloud flare unique visitors counts requests made by other federated instances. My solo instance reads around 14k unique visitors in the past week.

[–] haui_lemmy@lemmy.giftedmc.com 2 points 1 year ago

Good question. i‘d have to check that. So far I‘m not sure how to find that out.

[–] yimo@discuss.tchncs.de 7 points 1 year ago

Thank you very much for the breakdown!

This is very useful to know for people new to self-hosting as myself :)

(And for developers wanting to improve their apps potentially)

[–] rem26_art@kbin.social 4 points 1 year ago (1 children)

oh wow thats interesting info. Thanks for sharing!

[–] haui_lemmy@lemmy.giftedmc.com 2 points 1 year ago

Thank you very much. I appreciate the good vibes. :)

[–] speaker_hat@lemmy.one 2 points 1 year ago (1 children)

Thank you very much! great practical insights.

If you plan to do it again, how about to increase the data timespan (e.g. 6 months)? it will also give insight about scale as the time passes?

[–] haui_lemmy@lemmy.giftedmc.com 3 points 1 year ago

Thanks! I appreciate it.

Sure, I‘ll probably increase the collection timespan. I just didn’t see the necessity before. The setup is about a month old so there‘s a lot still to learn and to experience.

Right now I‘m trying to figure out if I keep it running as it is with a bit spare disk space or if I start testing backups and maybe put it all in one script, either bash or ansible (have no experience with that).

i second that 6gb ram floor