Skip to Content
mlab docs

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:

StateWhereEffect of a second replica
Licence state and the hourly checkProcess memory, keyed to one instance id stored in MySQLBoth 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 memoryEach replica counts separately, so limits multiply.
Evidence and avatarsuploads volume, local filesystemA replica without the same volume serves 404s for files.
Request log./log, local filesystemSplit across hosts.
Background sweeps (enrichment cache, hourly)ProcessRun once per replica.

The executor is reached through a single EXECUTOR_URL, and there is one per deployment as well.

Sizing

Baseline from Installation:

ResourceMinimumRecommended
CPU2 cores4+ cores
RAM2 GB4–8 GB
Disk10 GB50 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); uploads with evidence (up to 50 MB per file); ./log by 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:

LimitValue
Ingestion1,000 alerts per minute per organisation; batch endpoint takes up to 200 alerts per call
JSON request body2 MiB
Evidence file50 MB
Concurrent outbound webhook calls16 per process
Sessions3 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:

VariableContainerValue
DB_HOST, DB_PORTappMySQL host and port (default 3306)
DB_USERNAME, DB_PASSWORDappMySQL account
CH_HOSTapp, executorClickHouse host
CH_USERNAME, CH_PASSWORDapp, executorClickHouse account

Constraints from the code:

  • The database name is fixed to mlabir on 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_HOST and CH_HOST are set under environment: 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:

  1. 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, then docker compose up -d. Never run both at once: they share one instance id and one licence.
  2. 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-stopped brings every container back.
  3. Database HA underneath. Combine either option with externally managed, replicated MySQL and ClickHouse to shorten the restore to just the uploads volume 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.

On this page