Sizing and scaling
Resource needs for an ir.mlab.sh host, which parts can be moved or grown, and what high availability really looks like for a single-instance platform.
ir.mlab.sh is a single-instance platform. Run exactly one app container per
deployment. Scale it vertically, move the databases out if you want, and get
availability from backups and a cold standby. Running two app replicas behind a
load balancer is not supported.
Why one app
Several pieces of state live in the app process or on its local disk:
| State | Where | Effect of a second replica |
|---|---|---|
| Licence state and the hourly check | Process memory, keyed to one instance id stored in MySQL | Both replicas present the same instance id; the licence model is one licence, one instance. |
| Rate limits (2FA codes, passkeys, ingestion at 1,000 alerts/min per organisation, test calls) | Process memory | Each replica counts separately, so limits multiply. |
| Evidence and avatars | uploads volume, local filesystem | A replica without the same volume serves 404s for files. |
| Request log | ./log, local filesystem | Split across hosts. |
| Background sweeps (enrichment cache, hourly) | Process | Run once per replica. |
The executor is reached through a single EXECUTOR_URL, and there is one per
deployment as well.
Sizing
Baseline from Installation:
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 2 GB | 4–8 GB |
| Disk | 10 GB | 50 GB+ (depends on retention) |
What drives each resource:
- RAM: mostly MySQL and ClickHouse. ClickHouse benefits most from extra memory on large filters and reporting queries.
- Disk: MySQL grows with alerts, cases, incidents and observables;
ClickHouse with the activity log and playbook runs (kept 2 years by TTL);
uploadswith evidence (up to 50 MB per file);./logby one JSON line per request until you delete old files; Docker's container logs unless capped (Monitoring and logs). - CPU: request handling, PDF report generation, enrichment fan-out and playbook runs.
Built-in ceilings that shape load:
| Limit | Value |
|---|---|
| Ingestion | 1,000 alerts per minute per organisation; batch endpoint takes up to 200 alerts per call |
| JSON request body | 2 MiB |
| Evidence file | 50 MB |
| Concurrent outbound webhook calls | 16 per process |
| Sessions | 3 concurrent per user, 7 days |
Tier limits (users, alerts, cases per month) come from your licence: see Licensing.
What you can scale
Vertically
Give the host more CPU, RAM and faster disk. This is the main lever.
Databases on separate hosts
Both databases can run outside the compose stack, for example on managed services
or dedicated VMs, with their own replication and backups. Remove the mysql and
clickhouse services (and the depends_on entries pointing at them) and set:
| Variable | Container | Value |
|---|---|---|
DB_HOST, DB_PORT | app | MySQL host and port (default 3306) |
DB_USERNAME, DB_PASSWORD | app | MySQL account |
CH_HOST | app, executor | ClickHouse host |
CH_USERNAME, CH_PASSWORD | app, executor | ClickHouse account |
Constraints from the code:
- The database name is fixed to
mlabiron both servers. Create it beforehand. - ClickHouse is reached on the native protocol, port 9000. There is no variable to change the port.
- Use ClickHouse 26.8, the version 1.1.0 is tested against.
- The accounts need DDL rights on
mlabir: migrations run at every boot. - In the stock compose file,
DB_HOSTandCH_HOSTare set underenvironment:and override.env. Edit them there.
A MySQL primary with a replica gives you a warm copy of the relational data; the app itself talks to one MySQL endpoint only.
High availability
What is realistic:
- Cold standby. A second host with the same compose file and
.env, containers stopped. On failure, restore the latest backup (Backup and restore) or attach the replicated volumes, thendocker compose up -d. Never run both at once: they share one instance id and one licence. - VM-level failover. Run the whole stack in a VM protected by your
hypervisor's HA or by replicated block storage. The platform restarts as it
would after a reboot;
restart: unless-stoppedbrings every container back. - Database HA underneath. Combine either option with externally managed,
replicated MySQL and ClickHouse to shorten the restore to just the
uploadsvolume and.env.
Plan your RPO with the backup frequency and your RTO with the restore time you measured in a restore test. The licence does not get in the way of a short outage: the kept signed licence keeps the console unlocked for up to 7 days without mlab.sh.