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.
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_buffers128 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 people | 200 people | 400 people | |
|---|---|---|---|
| Online, average / maximum | 65 / 78 | 126 / 138 | 219 / 267 |
| Server memory, average / maximum | 143 / 181 MB | 196 / 237 MB | 344 / 461 MB |
| Server CPU, average / 5 s peak | 0.29 / 0.94 cores | 0.65 / 1.32 cores | 1.15 / 1.66 cores |
| SFU memory | 19 MB | 19 MB | 19 MB |
| Messages in total | 1,381 | 2,767 | 5,073 |
| Database size | 49 MB | 90 MB | 254 MB |
| Media on disk | 74 MB | 185 MB | 265 MB |
| Message delivery, median / 99% | 0.4 / 1.4 s | 0.4 / 1.3 s | 1.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.