The secret to scalable #fediverse software is job queues and efficient in-memory data schema caches
Pixelfed has 10 different queues that handle 54 distinct jobs
From processing likes to de-duplicating certain inefficient inbox requests, we offload complex logic to background jobs
You can set balancing strategies, # of total workers, RAM limits per worker & much more!
Still have room to improve, but so far, we're keeping up without any scalability issues on pixelfed.social with 10K MAU π
We also use caching A LOT!
There is a framework level config cache for all the files in `config/*.php` but editing the `.env` file requires restarting php/nginx due to opcache
So I made a redis/db config cache that allows you to edit settings in the admin dashboard, with immediate effect
We cache post objects by ids in our own schema and transform them to Masto or Pixelfed format depending on the request, allowing both MastoAPI support and our many innovative features
Will blog about this π