Skip to content

Scaling

Computers, workers and the graphics card check: where the heavy work runs Watch on YouTube

The Frameleaf server is built so that several copies can run side by side. Put a gaming PC to work on transcoding and thumbnails, or spread the load across a small cluster, then hand the hardware back whenever you need it.

Most homes never need this. One server with the defaults handles a family library, and there are easier ways to get more done first:

Running several copies of the server is for manual Docker Compose installations. Manager looks after one set of containers on one server.

The one requirement is that every copy uses the same shared infrastructure:

  • the same PostgreSQL database, with the same database settings on every copy. Background queues live in PostgreSQL too, so there’s no Redis to share
  • the same files, mounted at the same path in every container

Each machine needs secure access to the shared database and media mounts. Keep the PostgreSQL data directory on local disk, even when your media is on a network share. The exact steps depend on your own infrastructure, so this works best if you’re comfortable managing it.

Each server container runs three workers: api for the web app and phone apps, microservices for background jobs, and edge for remote access. If you’re adding machines only to get through background work faster, turn off the API on them with FRAMELEAF_WORKERS_EXCLUDE=api; the edge worker then stays off too. See Split the server into containers.

Machine learning scales separately: run more machine learning containers and put a load balancer in front of them. See Remote machine learning and Workers and where jobs run.

You can scale down just as easily. All state lives in PostgreSQL and the file system, so it’s safe to stop a server container, for example to free your GPU for a game. As long as one container runs the API worker, you can still browse Frameleaf, and jobs wait until a worker is available to process them.

When a container stops, running jobs get a short grace period and then go back to waiting. See Stopping the server.