← Back to the chapter · Previous detail · Next detail →

Technical detail · MQTT Session Management

Offline queue budget at one message per minute

An MQTT broker can queue eligible incoming messages for a disconnected subscriber, a client registered to receive matching publications, while its saved session remains valid.

A queue-sizing worksheet assumes one incoming message per minute, a 100-byte payload and 40 bytes of broker metadata. One offline hour produces 60 messages. The modeled queue is 60 × (100 + 40) = 8,400 bytes, or 8.4 kB using decimal units. For 1,000 offline receivers, that subtotal is 8.4 MB.

After 24 hours, the same assumptions produce 1,440 messages and 201,600 bytes per receiver. For 10,000 receivers the subtotal is 2.016 GB. These figures model queued incoming traffic; they do not describe a broker collecting readings that offline publishers have not sent. Measure implementation overhead before treating a worksheet subtotal as a capacity requirement.

With Message Expiry Interval, the publication’s lifetime, set to 3600 seconds on each eligible publication, the same steady input leaves at most about 60 unexpired messages per offline subscriber before broker-specific limits. Session expiry removes the saved client state after its allowed lifetime, message expiry limits publication lifetime, and a queue cap limits stored messages; they address different parts of the budget. Record all of them rather than treating any single setting as the whole policy.

← Back to the chapter · Previous detail · Next detail →