Multiple Workers
Workers take queued runs from Governor independently. To run more workflows at once, run more workers. No other coordination is needed.
Kubernetes (Helm)
Set the number of workers with worker.replicaCount in your values.yaml:
worker:
replicaCount: 2
container:
config:
WORKER_DATASOURCES: '*'
Then apply it:
helm upgrade governor oci://synthesizedio.jfrog.io/helm/governor \
-f values.yaml \
--reuse-values
Each replica registers with Governor under its own ID, and checks for queued runs every 2 seconds.
| Groups | WORKER_DATASOURCES |
Effect |
|---|---|---|
Any (default) |
|
The workers take runs for any data source. |
One group |
|
The workers take only runs whose input and output data sources both have the Worker group |
All replicas share the same settings. For workers with different groups, for example one set per network, run extra workers next to those databases, as described in Synthesized Workers.
|
The chart sets
|
Docker Compose
Identical workers
To run several identical workers, scale the worker service with the docker-compose.multi-worker.yml overlay:
docker compose \
-f docker-compose.yml \
-f docker-compose.override.yml \
-f docker-compose.multi-worker.yml \
up --scale worker=3 --detach
The overlay removes the worker’s fixed host port binding, so the replicas don’t all try to bind port 8083 on the host. Port 8083 stays reachable inside the Docker network.
All replicas share the same AGENT_DATASOURCES and AGENT_TAGS. They appear in Administration > Workers with different IDs and the same tags, and any of them can take any run that matches. The Data source tags column shows each worker’s groups; * means any group.
Workers with different groups
--scale can’t give replicas different settings. For workers that serve different groups, or have different tags, define a separately named worker service for each, with its own AGENT_DATASOURCES and AGENT_TAGS. Then set each data source’s Worker group to match.
In the demo
On a fresh volume, the overlay also sets up a second output for the demo:
| What | How |
|---|---|
A second output database, |
Created by |
A second output data source in Governor |
Added by |
The Masking workflow writing to the second output |
Set by the same file |
The initdb scripts run only on a fresh volume. If you started the demo before, either recreate the volumes with docker compose down -v, which deletes all data, or create the output database and data source yourself in Governor.
Give each workflow its own output
Two workflows that run at the same time must write to different output databases. If they share one, the second fails straight away with:
Failed to claim sink. TDK is already running. Sink is already claimed by [<user>] at <timestamp>.
The output databases can be on the same database server, as long as the database names differ. Create one for each workflow that runs at the same time, and set it as that workflow’s output.
Limit database resources
Concurrent runs put more load on the databases. If your test databases run in Kubernetes, set memory limits on their pods, and cap the database’s own memory use, so they don’t run out of memory under load. For SQL Server, for example:
env:
- name: MSSQL_MEMORY_LIMIT_MB
value: "2048"
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "3Gi"
cpu: "2"
Use the equivalent setting for other databases.
Docker Compose and Helm compared
| Docker Compose | Kubernetes (Helm) | |
|---|---|---|
Variable prefix |
|
|
Worker groups |
|
|
How to add workers |
|
|
Port conflicts when scaling |
Solved by the overlay |
None: each pod has its own address |