this post was submitted on 25 Jul 2023
6 points (87.5% 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
 

in Communities create community/edit community there is a SiteLanguage::read with no site_id, should that call to read have site_id = 1?

For reference, on my production instance my site_language table has 198460 rows and my site table has 1503 rows. Average of 132 languages per site. counts: https://lemmyadmin.bulletintree.com/query/pgcounts?output=table

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago

This is only during an update to the community, correct? As in, changing some community setting?

If that's the case, it is ensuring that the languages selected for the community are a subset of the site languages and not some arbitrary value. Which is necessary for ensuring that funny business has not been done to the community settings via some raw call or request manipulation.

If it's only doing this on community edits, then the performance hit is worth it since it shouldn't be done very frequently in the normal course of use.

Try profiling the time it takes to complete the update request and see if it is actually as bad as you think.

Another option would be to check the languages provided to see if they have been changed, and only do the subset check if they have. That's really the only time it matters to make that check.