Blog - MQTT QoS and backpressure — when QoS 2 hurts
Why higher MQTT QoS is not always more reliable in industrial telemetry, and how to model flow control.
- Author
- 2code
- Published
- Tags
- MQTT
- IoT
- backpressure
In Modbus → MQTT integrations there is a common instinct: “set QoS 2, it’ll be safest.” Under telemetry bursts, QoS 2 can increase latency and deliver stale data.
Queue model
Assume a broker or edge gateway has a finite queue of capacity . With arrival rate msg/s and service rate msg/s, utilization is:
As , the mean queue length (M/M/1) grows as:
QoS 2 adds handshake round-trips (PUBREC / PUBREL / PUBCOMP), so effective drops — rises faster than with QoS 0/1.
Decision flow
…
Practical rule
- High-frequency telemetry — QoS 0 + coalescing (latest value wins).
- Alarms / commands — QoS 1 (at least once) with an idempotent consumer.
- QoS 2 — only when exactly-once is a business requirement and volume is low.
…
Latency budget
If you accept max delay seconds during bursts, with mean message size bytes and bandwidth B/s:
Exceeding without drop/coalesce means “reliable” QoS 2 still delivers stale samples.
Takeaway
Reliability in IoT is not max QoS — it is an explicit contract: which data must always arrive, and which only needs “latest wins.”