Docs

Sizing

A calculator of memory, CPU, disk and bandwidth for a federation, based on load test measurements.

The calculator works from the measurements below. Enter your number of people and how actively they write. The numbers are approximate: real load depends on how people use Comon, so after launch watch the server's metrics.

Federation server
90 online
203 MB · 0.16 cores
PostgreSQL
with default settings
430 MB
Database
19.0 GB
Media files
427.7 GB
SFU: incoming
ceiling from the codecs
11.2 Mbit/s
SFU: outgoing
ceiling from the codecs
31.6 Mbit/s
Machine for the server, database and SFU
2 cores · 3 GB of memory · 460 GB of disk
with 2× headroom, without Keycloak and the proxy

How it is calculated

  • Federation server: 120 MB plus 0.92 MB per person online; 0.0052 cores per online person acting once every 20 seconds. The "Actions per minute" field scales this to your activity: the test made 3 actions a minute, real people usually make fewer.
  • PostgreSQL: about 430 MB with default settings (shared_buffers 128 MB). More memory makes the database faster, but only this minimum is required.
  • Database: about 3 KB per message with its search index, plus up to 0.6 MB per person: each person's sync feed keeps their last 1000 events at 0.6 KB each. An empty database takes 14 MB. In a short test the feeds have not reached that cap yet, so the database size in the table below divided by the number of messages is much more than 3 KB.
  • Media: exactly what people upload. By default each person may store up to 50 GiB (limits).
  • Calls: a ceiling from the codec settings, not a measurement. A camera sends three layers to the SFU (150 + 500 + 1500 kbit/s), a receiver of a large tile takes the top one (1500 kbit/s), of a small one the lower ones; voice is 40 kbit/s. One-to-one calls go directly or through TURN and do not load the SFU.
  • Machine: twice the memory and CPU the server, database and SFU need, plus 1 GB of memory and 10 GB of disk for the system; at least 2 cores, 2 GB of memory and 20 GB of disk. Keycloak, Caddy, the web client and bridges are not included: add their memory separately (Keycloak: see its documentation).

Measurements

The comon_load load test: real CDLib clients on the same machine sign up, join groups, channels and a community, write text, send photos, files, voice and round video messages and stickers, call, read and go offline. Each online person acts once every 20 seconds, a session lasts 3 minutes, a break 2 minutes. The steady phase is 5 minutes.

Machine: 4 vCPU Intel Xeon 2.1 GHz, 16 GB of memory, PostgreSQL 16 with default settings, the 0.2.4 server and the SFU compiled to native code.

100 people200 people400 people
Online, average / maximum65 / 78126 / 138219 / 267
Server memory, average / maximum143 / 181 MB196 / 237 MB344 / 461 MB
Server CPU, average / 5 s peak0.29 / 0.94 cores0.65 / 1.32 cores1.15 / 1.66 cores
SFU memory19 MB19 MB19 MB
Messages in total1,3812,7675,073
Database size49 MB90 MB254 MB
Media on disk74 MB185 MB265 MB
Message delivery, median / 99%0.4 / 1.4 s0.4 / 1.3 s1.8 / 31.5 s

400 people hit the machine, not the server

The test's clients ran on the same machine and took almost all 4 cores (load average 10), so latency grew and some requests timed out. The server's CPU stayed on the line of 0.0052 cores per online person, while its memory grew more because of queues. The calculator is built from the 100 and 200 people runs.

How to repeat the test on your machine is in the runbook.

On this page