← Back to the chapter · Previous detail

Technical detail · MQTT Python: Reconnect and Backoff Timing

Capacity, delivery and status worksheet assumptions

MQTT capacity and delivery worksheets predict outcomes from assumptions that need separate checks against a running system.

The capacity worksheet starts with 500 devices, 5 backend services, and 2 monitoring tools. It adds a device allowance, assumes two connections per backend service and three per monitoring tool, then applies separate headroom. Its output is 740 connection slots. That does not prove a broker, the service routing MQTT publications to subscribers, can sustain the connections or their reconnect burst.

The delivery worksheet assumes eligible exchanges finish after reconnection and treats requested subscription QoS, the delivery assurance level, as granted. Actual loss and repeats also depend on session state, buffering, limits, and retries. Session state is the connection-related information the broker and client preserve for later use. Inspect the receiver record and granted subscription instead of treating a model output as an observation.

A retained online status, stored by the broker for later subscribers, can outlive an unexpectedly lost client. A configured Last Will is a message the broker can publish on detecting that loss; it is not immediate proof of physical health. After reconnecting, check a fresh received reading. For high publishing load, measure sustained rate and latency before adding connections, because extra connections also change reconnect load.

← Back to the chapter · Previous detail