this post was submitted on 13 Jun 2023
1 points (66.7% liked)
Lemmy Server Performance
420 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
These instructions assume you installed "Lemmy from scratch" on Linux (as opposed to Docker, or FreeBSD instead of Linux, etc).
Linux shell on server of instance
Change users to the database Linux account:
sudo -iu postgres
Open the PostgreSQL shell client application:
psql
query the database server about table locks
select * from pg_locks;
from psql shell, list the lemmy_server tables
connect to the database named "lemmy":
\c lemmy
You are now connected to database "lemmy" as user "postgres".
List the tables in the database:
\dt
query to list Community joins that are pending
SELECT * FROM community_follower WHERE pending='t';
This kind of query I'd like to work on adding to the server admin screens for operators.
query to list Communities by name
SELECT id,instance_id,name,title,local,published FROM community ORDER BY name;
edit: tickle federation replication
why would community joins be pending?
edit: Ah I see. A better query might be:
which will show you the user, the community they're trying to join, and the instance they're trying to join on. Example:
(redacted my users in case they don't want it known what they're trying to join.
Thank you for sharing the query.
I believe it is a glaring symptom of federation replication failure. Data isn't making it back from the remote server to confirm the join. Either the outbound never made it to the remote, or the remote never made it back to your server. Multiple instances have had users complaining of these federation failures, example: https://lemmy.ml/post/1280517
You (the end-user) can try to cancel the join of the community and join again to trigger new connection to the server. I would also add the date to the output so you can try to see when these failures are happening (are they all on the same day?)
What software are you using to view the queries?
I use DataGrip. It's fantastic.
Yeah sorry, I didn't realize you meant remote community joins. I have had that problem in fact I still can't join several communities due to that issue.