Home

How "heavy" is self-hosting matrix really?

$$5317
https://programming.dev/u/chasteinsect posted on Feb 28, 2026 19:11

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.

https://programming.dev/post/46487038
Reply
$$5324
https://lemmy.today/u/LodeMike posted on Feb 28, 2026 19:38
In reply to: https://programming.dev/post/46487038

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.

https://lemmy.today/comment/22570409
Reply
$$5325
https://lemmy.today/u/LodeMike posted on Feb 28, 2026 19:40
In reply to: https://lemmy.today/comment/22570409

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?

https://lemmy.today/comment/22570450
Reply
$$5327
https://lemmy.pierre-couy.fr/u/pcouy posted on Feb 28, 2026 19:49
In reply to: https://programming.dev/post/46487038

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

https://lemmy.pierre-couy.fr/comment/2961459
Reply
$$5343
https://slrpnk.net/u/poVoq posted on Feb 28, 2026 20:22
In reply to: https://programming.dev/post/46487038

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 makers of Matrix should have realized that early on. Their bosses back then actually did, but they spun it of as a separate company and got some crypto-currency investments so the can was kicked down the road and here we are…

https://slrpnk.net/comment/20990259
Reply
$$5346
https://europe.pub/u/cRazi_man posted on Feb 28, 2026 20:29
In reply to: https://slrpnk.net/comment/20990259

Is there a good alternative that you would recommend?

https://europe.pub/comment/6221283
Reply
$$5348
https://lemmy.zip/u/illusionist posted on Feb 28, 2026 20:33
In reply to: https://slrpnk.net/comment/20990259

Any source for the coin stuff? Never read about it

https://lemmy.zip/comment/24944675
Reply
$$5349
https://slrpnk.net/u/poVoq posted on Feb 28, 2026 20:34
In reply to: https://europe.pub/comment/6221283

XMPP obviously. Have a look at https://joinjabber.org/

https://slrpnk.net/comment/20990414
Reply
$$5350
https://slrpnk.net/u/poVoq posted on Feb 28, 2026 20:37
In reply to: https://lemmy.zip/comment/24944675

They 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.

https://slrpnk.net/comment/20990447
Reply
$$5357
https://lemmy.cafe/u/Onomatopoeia posted on Feb 28, 2026 20:56
In reply to: https://slrpnk.net/comment/20990414

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

https://lemmy.cafe/comment/16141682
Reply
$$5361
https://lemmy.today/u/northernlights posted on Feb 28, 2026 21:07
In reply to: https://lemmy.today/comment/22570409

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.

screenshot of cloudbeaver

https://lemmy.today/comment/22572180
Reply
$$5364
https://sh.itjust.works/u/SreudianFlip posted on Feb 28, 2026 21:11
In reply to: https://lemmy.cafe/comment/16141682

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

https://sh.itjust.works/comment/24030876
Reply
$$5369
https://feddit.org/u/littleomid posted on Feb 28, 2026 21:23
In reply to: https://programming.dev/post/46487038

Barely 1-2% CPU usage. Using synapse.

https://feddit.org/comment/11773671
Reply
$$5398
https://lemmy.blahaj.zone/u/Neptr posted on Feb 28, 2026 21:50
In reply to: https://sh.itjust.works/comment/24030876

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

https://lemmy.blahaj.zone/comment/19413058
Reply
$$5404
https://scribe.disroot.org/u/drkt posted on Feb 28, 2026 22:09
In reply to: https://lemmy.today/comment/22572180

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?

https://scribe.disroot.org/comment/9698838
Reply
$$5406
https://lemmy.world/u/Eldaroth posted on Feb 28, 2026 22:22
In reply to: https://sh.itjust.works/comment/24030876

I believe group calling is only a thing certain clients (e.g. Dino, Movim) support, although there is a initiative to implement it on protocol level as far as I am aware.

https://lemmy.world/comment/22403495
Reply
$$5409
https://sh.itjust.works/u/SreudianFlip posted on Feb 28, 2026 22:23
In reply to: https://lemmy.blahaj.zone/comment/19413058

Neither of those client promo pages mention group calling. le sigh

https://sh.itjust.works/comment/24032015
Reply
$$5414
https://sh.itjust.works/u/SreudianFlip posted on Feb 28, 2026 22:31
In reply to: https://lemmy.world/comment/22403495

So, Onomatopoeia there is wondering why xmpp isn’t standard, and I’m getting the sense that it is targeted at oldskool usage.

Discord is popular because it’s easy to start using, it has collaboration features like group screensharing, and it doesn’t assume an ubernerd is the target audience.

Maybe we’ll get a more unified, feature rich xmpp implementation, but until then, sounds like matrix/element is closer, despite its warts.

https://sh.itjust.works/comment/24032149
Reply
$$5437
https://lemmy.today/u/northernlights posted on Feb 28, 2026 23:10
In reply to: https://scribe.disroot.org/comment/9698838

I purge 2 weeks old media using these. Then I purge the largest rooms’ history events using these. Then I compress the DB using this.

It looks like this:

export PGPASSWORD=$DB_PASS
export MYTOKEN="mytokengoeshere"
export TIMESTAMP=$(date --date='2 weeks ago' '+%s%N' | cut -b1-13)

echo "DB size:"
psql --host core -U synapse_user -d synapse -c "SELECT pg_size_pretty(pg_database_size('synapse'));"

echo "Purging remote media"
curl \
	-X POST \
	--header "Authorization: Bearer $MYTOKEN" \
	"http://localhost:8008/_synapse/admin/v1/purge_media_cache?before_ts=%24%7BTIMESTAMP%7D"

echo ''
echo 'Purging local media'
curl \
	-X POST \
	--header "Authorization: Bearer $MYTOKEN" \
	"http://localhost:8008/_synapse/admin/v1/media/delete?before_ts=%24%7BTIMESTAMP%7D"

echo ''
echo 'Purging room Arch Linux'
export ROOM='!usBJpHiVDuopesfvJo:archlinux.org'
curl \
	-X POST \
	--header "Authorization: Bearer $MYTOKEN" \
	--data-raw '{"purge_up_to_ts":'${TIMESTAMP}'}' \
	"http://localhost:8008/_synapse/admin/v1/purge_history/$%7BROOM%7D"

echo ''
echo 'Purging room Arch Offtopic'
export ROOM='!zGNeatjQRNTWLiTpMb:archlinux.org'
curl \
	-X POST \
	--header "Authorization: Bearer $MYTOKEN" \
	--data-raw '{"purge_up_to_ts":'${TIMESTAMP}'}' \
	"http://localhost:8008/_synapse/admin/v1/purge_history/$%7BROOM%7D"

echo ''
echo 'Compressing db'
/home/northernlights/scripts/synapse_auto_compressor -p postgresql://$DB_USER:$DB_PASS@$DB_HOST/$DB_NAME -c 500 -n 100

echo "DB size:"
psql --host core -U synapse_user -d synapse -c "SELECT pg_size_pretty(pg_database_size('synapse'));"

unset PGPASSWORD

And periodically I run vacuum;

https://lemmy.today/comment/22574555
Reply
$$5455
https://lemmy.world/u/Eldaroth posted on Feb 28, 2026 23:57
In reply to: https://sh.itjust.works/comment/24032149

Yeah you could consider it old school, or maybe just a product of another time were people didn’t mind to use multiple software for different uses.

I for one don’t mind using Mumble for voice and XMPP for text chat or one to one calls for example.

I don’t have a computer or smartphone so I only can install one app and that’s it. And I know I might be in the minority when it comes to that, at least compared to the general public. For gods sake it’s already hard to get people to install a second messenger app, not even trying to get them off WhatsApp or other meta crap…

https://lemmy.world/comment/22404754
Reply
$$5518
https://piefed.ca/u/iamthetot posted on Mar 1, 2026 03:16
In reply to: https://lemmy.cafe/comment/16141682

What client(s) do you use/prefer?

Like many, I am looking for a Discord replacement and (possibly hot take) I largely like Discord’s layout, UI, and chat flow. That is to say, I like threads, channels, categories, and “servers” (spaces, what-have-you) to partition my chat experience. There are a few Matrix clients that replicate this closely, but the XMPP ones I have seen so far at least were not very enjoyable user experiences for me.

(Not for nothing, I also have been able to get a Synapse server running on my homelab, but have thus far not been able to successfully get an XMPP server running so that’s not helping my experience either)

Happy to check out your suggestions.

https://piefed.ca/comment/3699615
Reply
$$5534
https://lemdro.id/u/stratself posted on Mar 1, 2026 04:43
In reply to: https://programming.dev/post/46487038

I wanna reshare my experiences here. Essentially it doesn’t scale well with large rooms, and isn’t friendly with janky/underpowered equipment like XMPP. But with a lot of performance tuning it can go a long way.

For a room, the amount of servers you federate with is a more reliable metric than member count (so 5000 accounts on 2 servers would likely take less load than 500 accounts on 500 servers, as an example). There are some large public rooms that are very broken, and I advise banning them before users get to join

https://lemdro.id/comment/22752016
Reply
$$5543
https://lemmy.today/u/hexagonwin posted on Mar 1, 2026 05:34
In reply to: https://piefed.ca/comment/3699615

it seems like movim is the most discord-ish xmpp client

https://lemmy.today/comment/22579458
Reply
$$5625
https://lemmy.world/u/jimmy90 posted on Mar 1, 2026 11:16
In reply to: https://feddit.org/comment/11773671

yeah me too it’s mostly very chill

https://lemmy.world/comment/22411308
Reply
$$5630
https://startrek.website/u/polarity_inverter posted on Mar 1, 2026 11:36
In reply to: https://lemmy.zip/comment/24944675

You could even argue it with the data structures and the protocol itself: Modelling chat rooms as graphs (“directed acyclic graphs”), which need to be eventually consistent from beginning to end is plain madness for big and long-living public spaces. This blog post is a good collection of some of the major problems coming from that: Why not Matrix? - telegra.ph

https://startrek.website/comment/21674709
Reply
$$5669
https://slrpnk.net/u/Yaky posted on Mar 1, 2026 13:39
In reply to: https://lemmy.today/comment/22574555

Thank you for the queries. The rhetorical question is why isn’t the server handling this.

https://slrpnk.net/comment/21001222
Reply
$$5673
https://slrpnk.net/u/Yaky posted on Mar 1, 2026 13:43
In reply to: https://programming.dev/post/46487038

TLDR: bare Synapse was fine on 1CPU 1GB RAM VPS, but uses lots of disk space (from large rooms). Current/future ESS requires Kubernetes and several services to be functional.

More info in my blog post

https://slrpnk.net/comment/21001262
Reply
$$5751
https://discuss.tchncs.de/u/cryptix posted on Mar 1, 2026 16:58
In reply to: https://programming.dev/post/46487038

Not good on raspberry pi4. It worked but slow…

https://discuss.tchncs.de/comment/24240098
Reply
$$5794
https://lemmy.today/u/northernlights posted on Mar 1, 2026 18:26
In reply to: https://slrpnk.net/comment/21001222

I don’t know, can’t speak for the devs.

https://lemmy.today/comment/22590368
Reply
$$5985
https://sh.itjust.works/u/WhyJiffie posted on Mar 2, 2026 01:28
In reply to: https://slrpnk.net/comment/21001262

I don’t know, I would not recommend kubernetes to most people not already familiar with it, but especially to beginners. It’s too many moving parts, and fir most selfhosted setups, its capabilities are not needed I think.

https://sh.itjust.works/comment/24051809
Reply
$$6077
https://sh.itjust.works/u/WhyJiffie posted on Mar 2, 2026 06:10
In reply to: https://lemmy.today/comment/22570409

Make regular backups of the DB.

tbh that should apply to any kind of selfhosted service, especially when its not only for you

https://sh.itjust.works/comment/24054557
Reply
$$6078
https://sh.itjust.works/u/WhyJiffie posted on Mar 2, 2026 06:15
In reply to: https://lemmy.today/comment/22590368

are the messages redownloaded from other servers when someone tries to load them? I guess all local media is lost forever, but maybe not remote ones

https://sh.itjust.works/comment/24054603
Reply
$$6115
https://reddthat.com/u/dr_robotBones posted on Mar 2, 2026 07:31
In reply to: https://programming.dev/post/46487038

I’m hosting a matrix instance using synapse on a shitty old laptop with 8 gigs of RAM and a Ryzen 3 2200U

https://reddthat.com/comment/25098936
Reply
$$6117
https://sh.itjust.works/u/ohshit604 posted on Mar 2, 2026 07:42
In reply to: https://programming.dev/post/46487038

My synapse instance was essentially DDOS’ing me when I attempted to join or load large rooms, setting up a cache on the reverse proxy level and forcing it to use my secondary PiHole mitigated this to some extent.

https://sh.itjust.works/comment/24055412
Reply
$$6120
https://lemmy.decronym.xyz/u/Decronym posted on Mar 2, 2026 07:50
In reply to: https://programming.dev/post/46487038

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
PiHole Network-wide ad-blocker (DNS sinkhole)
VPS Virtual Private Server (opposed to shared hosting)
XMPP Extensible Messaging and Presence Protocol (‘Jabber’) for open instant messaging

[Thread #126 for this comm, first seen 2nd Mar 2026, 07:50] [FAQ] [Full list] [Contact] [Source code]

https://lemmy.decronym.xyz/comment/14768
Reply
$$6127
https://lemmy.dbzer0.com/u/Appoxo posted on Mar 2, 2026 08:02
In reply to: https://lemdro.id/comment/22752016

and I advise banning them before users get to join

Why does this feel like a fundamental problem to me?

https://lemmy.dbzer0.com/comment/24710192
Reply
$$6257
https://lemmy.zip/u/motruck posted on Mar 2, 2026 15:33
In reply to: https://slrpnk.net/comment/21001262

Nothing requires kubetnetes. Can you scale with kubetnetes easier? Maybe, but then you’d have to learn kubetnetes. Even super scalers like Netflix ran for decades without kubetnetes and then for other reasons they moved. Self hosters only need kubetnetes if they want to learn it.

https://lemmy.zip/comment/24981163
Reply
$$6294
https://lemmy.ml/u/communism posted on Mar 2, 2026 17:04
In reply to: https://programming.dev/post/46487038

There are different server implementations. I run tuwunel and haven’t had problems. It seems about as performant on my VPS (8GB RAM, 4 CPUs at 2.4 GHz, hosting other services not just tuwunel) as matrix.org was when I used that.

https://lemmy.ml/comment/24281932
Reply
$$6315
https://jlai.lu/u/arcine posted on Mar 2, 2026 17:56
In reply to: https://startrek.website/comment/21674709

Welp. This comment has completely killed all my enthusiasm for matrix 😅 I had no idea it was such a horrible mess under the hood…

I’m trying to move some communities off Discord to something self hosted but I don’t know enough about SMPP to know if it would do the job.

https://jlai.lu/comment/19764090
Reply
$$6352
https://slrpnk.net/u/Yaky posted on Mar 2, 2026 20:02
In reply to: https://lemmy.zip/comment/24981163

It’s possible to run the services without Kubernetes, but official ESS Community uses Kubernetes.

ESS Community works ‘out-of-the-box’ on a single machine or existing Kubernetes cluster using the provided Helm charts.

https://slrpnk.net/comment/21025139
Reply
$$6355
https://slrpnk.net/u/Yaky posted on Mar 2, 2026 20:18
In reply to: https://startrek.website/comment/21674709

I knew of some of these issues with the protocol, but this article definitely gives an impression that Matrix was built as a “cool protocol” first, with messaging applied on top as an afterthought.

https://slrpnk.net/comment/21025418
Reply
$$6448
https://lemmy.today/u/northernlights posted on Mar 3, 2026 00:16
In reply to: https://sh.itjust.works/comment/24054603

In my understanding that’s the idea, the local ones are lost unless another federated instance synced them. As for the remote ones, maybe they’re backed up but I really don’t care for an instant messaging platform to not have a rear view past 2 weeks.

https://lemmy.today/comment/22619589
Reply
$$6551
https://sh.itjust.works/u/WhyJiffie posted on Mar 3, 2026 06:54
In reply to: https://lemmy.today/comment/22619589

unless another federated instances synced them

I don’t think the homeserver tries to fetch media remotely that was local but since deleted

we often talk about how discord is a black hole of information, but this is worse than that

https://sh.itjust.works/comment/24074666
Reply
$$6693
https://lemmy.cafe/u/Onomatopoeia posted on Mar 3, 2026 15:38
In reply to: https://sh.itjust.works/comment/24032149

Its not “targeted at old school”, its an open, extensible protocol.

If devs focused on extending the protocol instead of building an app to handle things like this, it could do it.

https://lemmy.cafe/comment/16182383
Reply
$$6729
https://sh.itjust.works/u/SreudianFlip posted on Mar 3, 2026 17:26
In reply to: https://lemmy.cafe/comment/16182383

Mucking about with dozens of extensions instead of just installing an app seems pretty old skool, lol, brings me back to bbs life

https://sh.itjust.works/comment/24083088
Reply