How "heavy" is self-hosting matrix really?
from chasteinsect@programming.dev to selfhosted@lemmy.world on 28 Feb 19:11
https://programming.dev/post/46487038

Hi. I’m kinda of a noob in the world of self-hosting and matrix, for that matter. But I was wondering how heavy is it to host a matrix server?

My understanding how matrix works is each participating server in the room stores the full history and then later some sort of merging happens or something like that.

How is that sustainable? Say in 5 years matrix becomes mainstream and 5 people join my server and each also join 3 different 10k+ people rooms with long histories. So now what I have to account for that or people have to be careful of joining larger rooms when they sign up in a smaller-ish server?

Or do I not understand how Matrix works? Thanks.

#selfhosted

threaded - newest

LodeMike@lemmy.today on 28 Feb 19:38 next collapse

It can baloon as it scales up. Matrix.org (homeserver) has had at least one DB corruption and that’s with their proprietary Rust bindings for Synapse. Small communities, especially ones that share rooms between them, should be fine on most systems. Make regular backups of the DB.

LodeMike@lemmy.today on 28 Feb 19:40 next collapse

There’s also issues with the state disagreement / resolution algorithms across federation.

Has this been solved? Maybe it’s also due to database corruption, where some state is forgotten across the federation, and thus the algorithm breaks down?

northernlights@lemmy.today on 28 Feb 21:07 collapse

And, importantly, run the db on postgre, not sqlite, and implement the regular db maintenance steps explained in the wiki. I’ve been running mine like that in a small VM for about 6 months, i join large communities, run whatsapp, gmessages and discord bridges, and my DB is 400MB.

Before when I was still testing and didn’t implement the regular db maintenance it balloned up to 10GB in 4 months.

<img alt="screenshot of cloudbeaver" src="https://lemmy.today/pictrs/image/7ff9a544-3099-48dd-a31a-3a489a19ae7c.png">

drkt@scribe.disroot.org on 28 Feb 22:09 collapse

It is my understanding that all of the ballooning DB is room states, something that you can’t really prune. What exactly are you pruning from the DB?

pcouy@lemmy.pierre-couy.fr on 28 Feb 19:49 next collapse

I don’t know about other homeserver implementations but synapse kinda sucks. It used to randomly eat 100% of 1 or 2 CPU cores (including the database) until I tracked it down to 3 rooms having a messed up state which caused costly SQL queries. I removed the rooms from my server (using a third party admin panel because there’s no proper admin GUI built in, the documentation just mentions curl commands to hit the admin API, with placeholders to manually replace). It has been fine since I did it, but I’m the only user on my server. And I expect other issues to come up at any time…

It also eats a lot of storage, mostly the database. It grew very large quickly, but it’s more stable now

poVoq@slrpnk.net on 28 Feb 20:22 next collapse

This is a fundamental issue of the Matrix protocol, yes. For regular small scale use it doesn’t matter so much, and the state history gets reset every time you do a room upgrade, which is another annoying “feature” of Matrix, but it eases the fundamental problem a bit.

But IMHO the Matrix protocol is a child of the Bitcoin hype era and is built on a similar data-structure that is inherently impossible to scale and the developers of Matrix should have realized that early on. Their bosses back then actually did, but they spun it off as a separate company and got some crypto-currency investments so the can was kicked down the road and here we are…

cRazi_man@europe.pub on 28 Feb 20:29 next collapse

Is there a good alternative that you would recommend?

poVoq@slrpnk.net on 28 Feb 20:34 collapse

XMPP obviously. Have a look at joinjabber.org

Onomatopoeia@lemmy.cafe on 28 Feb 20:56 collapse

Still staggering to me that XMPP isn’t the default, since it was used in many chat apps in the late 90’s.

SreudianFlip@sh.itjust.works on 28 Feb 21:11 collapse

Does it do screen sharing, group calls, etc.?

Neptr@lemmy.blahaj.zone on 28 Feb 21:50 collapse

Screensharing is the only thing i dont think it does. Voice and video good. See snikket or conversations.im

illusionist@lemmy.zip on 28 Feb 20:33 collapse

Any source for the coin stuff? Never read about it

poVoq@slrpnk.net on 28 Feb 20:37 collapse

They (Element / New Vector) got a major early investment in 2018 from Status, a cryptocurrency/web3 company, and later in 2021 an even bigger one in relation to Protocol Labs, who peddle their own cryptocurrency.

littleomid@feddit.org on 28 Feb 21:23 collapse

Barely 1-2% CPU usage. Using synapse.