this post was submitted on 05 Jul 2023
24 points (100.0% liked)
Lemmy Server Performance
1 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
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
a large part of the queue going unbounded is due to the retry queue and missing checks if the receiving servers are actually available. quick fix is disabling the retry queue which is currently making it not go unbounded on lemmy.world
storing the queue persistently is somewhat of a separate issue since that doesn't much affect whether or not it can be processed in time.
also a ton of the memory use was (and is) due to inefficient sql queries.
I guess that works as an emergency measure. Persistent storage doesn't affect whether the updates are processed in time, but it would act as a sort of swap to keep the memory usage manageable.
For scalability, perhaps, you could run dijkstra and route the updates using the shortest path to each federated node, in a multicast sort of way? That would make the updates scale in a
O(log(N))
way, provided that activity isn't too centralised. It would also be great to run periodic "deep scrubs" between instances to sync up each other's activities and provide actual eventual consistency. I guess that's kind of a liberal interpretation of ActivityPub, but I think that's the only way to ensure real scalability.