By default, each gateway runs its driver in its own process. A cluster is a group of gateways that run together in one shared process, which saves memory on installations with many gateways. The cluster is chosen per gateway, with the Cluster ID option of the gateway.
Every gateway is an instance of a driver. In the default mode, each gateway has a process of its own:
With a few gateways this cost does not matter. With dozens of gateways on one device, it can use up the memory.
Gateways that share a Cluster ID run in a single process and load the runtime once. The memory saved grows with the number of gateways in the cluster.
Own process (Cluster ID 0) |
Cluster (Cluster ID 1, 2, …) |
|
|---|---|---|
| Memory | One runtime per gateway | One runtime for the whole cluster |
| Memory limit | One limit per gateway | One common limit for the cluster |
| Fatal driver error | Only this gateway restarts | All gateways of the cluster restart |
| Processing | Each gateway has its own thread | The gateways share one thread |
The option is in the gateway (driver) options:
0 (default): the gateway runs in its own process;All gateways with the same Cluster ID share one process, whatever their driver: a cluster can mix Modbus, MQTT and HTTP gateways, for example. There is nothing to create first. A cluster starts with its first active gateway and stops when its last gateway is deactivated or deleted.
An active gateway restarts when its Cluster ID changes, because it moves to another process.
The same field is available when you insert a gateway. Through the API, it is the cluster property of the gateway object.
A few drivers always run in their own process and do not show the field, for example System, Virtual and Z-Wave.
Administrators have an overview in the System section, under Clusters configuration. The page lists the gateways and logic circuits, grouped by cluster, with their driver, state and status.
On this page you can:
Clusters fit well when:
Keep a gateway in its own process (Cluster ID 0) when:
0 to isolate it, with its own memory limit and its own crash log.Prefer several small clusters of related gateways over one large cluster: a restart then only touches gateways that belong together.