Email or username:

Password:

Forgot your password?
dansup

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 πŸ˜‰

5 comments
dansup

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 😎

Sven

@dansup FYI it’s good practice to load the values from the `.env` file into the OS-level environment variables instead of reading from the file every time.

gist.github.com/mihow/9c7f5598

dansup

@svenluijten The laravel framework we use does that, .env values are referenced in the `config/*.php` files which are basically KV arrays that are compiled and cached.

The opcache php extension requires one to restart php-fpm after editing the .env because it's cached so hard

dansup

10K MAU may not seem like much compared to some instances, but the fact it runs on a single $50 VPS speaks volumes.

Cameron

@dansup I think 10K MAU is a good number for a fediverse instance.

TBH I think the 27k active users on the instance I use is pushing how large an instance should be. I sometimes regret not starting on a smaller one, and may still move/switch focus.

Go Up