Sizing and Scaling Observability
This document explains which signals to watch to size a Lemline deployment and decide when to add capacity. Lemline has no built-in autoscaler or sizing tool: it exposes metrics, and you scale with your platform (processes, Kubernetes replicas, broker partitions, database).
What Uses Resources
Component | Main resources | Grows with |
|---|---|---|
Runner ( | CPU, memory, broker and database connections | Steps executed per second, consumer concurrency, size of workflow data |
Gateway ( | CPU, database connections | Start requests, open watch streams |
Message broker | Disk, network | Messages per second, retention |
Database | CPU, I/O, storage | Waits, retries, schedules, listeners, definitions, failures, analytics |
Workflow data travels inside every message of an instance, so large inputs and outputs increase broker traffic and runner memory.
Signals to Watch
All Lemline metrics are listed in the Metrics Reference.
Question | Signal |
|---|---|
Is a runner saturated? |
|
Are runners keeping up? | Broker consumer lag (Kafka) or queue depth (RabbitMQ, PGMQ), from the broker's own monitoring |
Are steps getting slower? |
|
Is memory sufficient? |
|
Are messages failing? |
|
Are runners missing for a namespace? |
|
The database and the broker are shared by every runner: watch them with their own tools.
Sizing Guidelines
Start with two runners for availability, then add runners while lag grows.
With Kafka, create topics with at least as many partitions as the maximum number of runners.
Raise
lemline.messaging.<broker>.<channel>.consumer.concurrencywhen runners mostly wait on remote calls and CPU stays low; lower it when memory runs short.Size the database for the number of runners and gateways connected to it, and for the background processing (waits, retries, schedules) that every runner performs.
Scaling
See How to Configure Scaling for adding runners, splitting work by namespace and using a Kubernetes Horizontal Pod Autoscaler.
Alerts
Example Prometheus rules based on real metrics:
Adjust the saturation threshold if you changed the concurrency.