this post was submitted on 23 Jul 2023
2 points (100.0% liked)

Lemmy Server Performance

2 readers
1 users here now

Lemmy Server Performance

lemmy_server uses the Diesel ORM that automatically generates SQL statements. There are serious performance problems in June and July 2023 preventing Lemmy from scaling. Topics include caching, PostgreSQL extensions for troubleshooting, Client/Server Code/SQL Data/server operator apps/sever operator API (performance and storage monitoring), etc.

founded 1 year ago
MODERATORS
 

Details here: https://github.com/LemmyNet/lemmy/issues/3165

This will VASTLY decrease the server load of I/O for PostgreSQL, as this mistaken code is doing writes of ~1700 rows (each known Lemmy instance in the database) on every single comment & post creation. This creates record-locking issues given it is writes, which are harsh on the system. Once this is fixed, some site operators will be able to downgrade their hardware! ;)

top 7 comments
sorted by: hot top controversial new old
[–] _Rho_@lemmy.world 0 points 1 year ago (1 children)

This is fascinating

My biggest takeaway from reading through the GitHub comments though is that it seems like no one actually knows where much of the SQL comes from? As in it's possible that the bug in question is just one manifestation of old, handwritten Postres code that may or may not be optimized (Or even logical?).

I don't mean this in a critical way, as things like this are bound to happen in an open-source, federated world. However, I would think a comprehensive audit of the Lemmy Postgres triggers, queries, etc could potentially save us all from some future headaches.

[–] Aux@lemmy.world -2 points 1 year ago (1 children)

That's not fascinating, that's depressing. Lemmy team lacks development skill.

[–] basequal@lemmy.world 0 points 1 year ago* (last edited 1 year ago) (1 children)

I am always fascinated with these types of comments, specifically for a free and open-source software. There are lemmy instances supporting hundreds of thousands of users and trafic, feedback from both server owners and lemmy devs is almost instantaneous.

A platform like lemmy requires client side knowledge to build both desktop and mobile UI (that are performant), it requires ActivityPub knowledge to integrate with the Fediverse, it requires backend knowledge to build APIs for 100% feature compatibility with 3rd party apps. It requires DB knowledge to optimize queries, it requires devops / platform knowledge to deploy it.

And all of this is built in public.

BuT LEMmY tEaM lAcks dEvEloPmenT SkiLL – sure buddy.

[–] Aux@lemmy.world -3 points 1 year ago

What's so special about open source? Shit code is shit code.

[–] PochoHipster@lemmy.ml 0 points 1 year ago (1 children)