mqtt: raise default STATUS_INTERVAL from 1000 ms to 30000 ms

The full-status snapshot is a bootstrap / drift-correction mechanism;
per-event topics (talker, client, trunk, nodes) already deliver every
change live. The retained payload scales with mesh size — at a few
hundred nodes with the rich per-client status blob it is hundreds of
KB, which makes a 1 s republish expensive on broker bandwidth and
reflector CPU. Lower it explicitly via [MQTT] STATUS_INTERVAL only
when a small mesh has a consumer that depends on near-real-time full
snapshots.

Test configs keep STATUS_INTERVAL=1000 to verify retained-status
behaviour in seconds.
This commit is contained in:
Audric committed 2026-04-28 11:30:50 +02:00
1 parent a3757ca634
commit d9ec356f10
4 files changed
+22 -7

No files matched your search

+10 -2
View File
@@ -492,8 +492,16 @@ bool Reflector::initialize(Async::Config &cfg)
}
else
{
// Set up periodic status publishing
unsigned status_interval = 1000;
// Set up periodic status publishing.
// Default 30 s: the full snapshot is intended as a drift-correction /
// bootstrap mechanism for new subscribers. Real-time changes already
// reach the broker via the per-event topics (talker/start|stop,
// client/connected|disconnected, trunk/up|down, nodes/local,
// nodes/<peer>). Republishing the full m_status every second is
// proportional to the number of nodes in the mesh — at a few
// hundred nodes with rich per-client status it becomes hundreds of
// KB/s of largely redundant retained traffic.
unsigned status_interval = 30000;
cfg.getValue("MQTT", "STATUS_INTERVAL", status_interval);
m_mqtt_status_timer.setTimeout(status_interval);
m_mqtt_status_timer.setEnable(true);