Offline Time Is the Unbounded Term

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
mqtt
Ada ADA · CALCULATION AUDIT

Offline Time Is the Unbounded Term

A persistent MQTT session queues every message a sleeping client misses, and each one costs about 100 bytes of payload plus 40 bytes of broker metadata — 140 bytes. A sensor offline for one hour at one message a minute piles up about 8 KB; across 1000 sensors that is 8.4 MB. This audit makes the growth law explicit to show that offline time, not message size, is the unbounded term.

Companion to the chapter MQTT Session Management — every number here comes from that chapter.

Ada: This section shows queue memory growing with the offline window, and I want to make the growth law explicit, because it is what turns a persistent session from a convenience into a broker-memory liability. Every queued message costs M_payload + M_overhead = 100 + 40 = 140 bytes.

  • One hour offline at 1 msg/min: 60 x 140 = 8,400 bytes, about 8.4 KB per sensor
  • The same across 1000 sensors: 1000 x 8,400 = 8,400,000 bytes = 8.4 MB
  • One day offline: 1440 x 140 = 201,600 bytes, about 197 KiB per sensor
  • Ten thousand sensors offline for that day: 10,000 x 201,600 = 2,016,000,000 bytes = 1.88 GiB

The only thing that changed between 8.4 KB and 197 KB is the message count, which is just offline minutes: 1440 / 60 = 24x longer offline gives 24x the memory, with no ceiling. That is why message expiry matters, since capping delivery to a one-hour window pins each sensor back to 60 x 140 = 8,400 bytes no matter how long it actually sleeps. The design choice is not whether to queue, but whether to bound the queue: without an expiry the broker’s RAM is hostage to the longest disconnection any single client can suffer.

Every number above is taken from the chapter’s own material and re-derived step by step.