this post was submitted on 23 Aug 2023
8 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
 

Lemmy is incredibly unique in it's stance of not using Redis, Memcached, dragonfly... something. And all the CPU cores and RAM for what this week is reported as 57K active users across over 1200 Instance servers.

Why no Redis, Memcached, dragonfly? These are staples of API for scaling.

Anyway, Reddit too started with PostgreSQL and was open source.

MONDAY, MAY 17, 2010

http://highscalability.com/blog/2010/5/17/7-lessons-learned-while-building-reddit-to-270-million-page.html

"and growing Reddit to 7.5 million users per month"

Lesson 5: Memcache
The essence of this lesson is: memcache everything.

They store everything in memcache: 1. Database data 2. Session data 3. Rendered pages 4. Memoizing (remember previously calculated results) internal functions 5. Rate-limiting user actions, crawlers 6. Storing pre-computing listings/pages 7. Global locking.

They store more data now in Memcachedb than Postgres. It’s like memcache but stores to disk. Very fast. All queries are generated by same piece of control and is cached in memcached. Change password Links and associated state are cached for 20 minutes or so. Same for Captchas. Used for links they don’t want to store forever.

They built memoization into their framework. Results that are calculated are also cached: normalized pages, listings, everything.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

I'll just say now that I haven't read everything, just skimmed through. Here's my 2¢

Considering Lemmy's contributors are volunteers, and Lemmy itself is written in rust, it'll probably be a really difficult one to try and attract knowledgeable volunteers willing to implement things like Redis and Memcached in a way that will hit the ground running.

Looking at how things are right now, I think the primary devs Dessalines and Nutomic are likely trying to power through the remaining outstanding features to get the next NLNet funding payout, so they can put food on the table.

After the funding comes to an end, I feel it's likely that we'll see a more ambitious roadmap calling on people to assist with implementing caching technologies, which will probably involve a big shakeup of the existing codebase