From 17be962e57b589fb90a5c5a5b92ae8d78ebcd3ed Mon Sep 17 00:00:00 2001 From: Mikkeli Date: Mon, 12 Oct 2026 20:48:41 +0900 Subject: [PATCH] mosquitto: set_tcp_nodelay, raw CAN throughput measured Nagle on the broker held small messages to subscribers ~40 ms at CAN rates. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz --- docs/impl/reports/MOSQUITTO.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/impl/reports/MOSQUITTO.md b/docs/impl/reports/MOSQUITTO.md index 3d402b3..21ba622 100644 --- a/docs/impl/reports/MOSQUITTO.md +++ b/docs/impl/reports/MOSQUITTO.md @@ -18,6 +18,7 @@ sudo apt-get install mosquitto mosquitto-clients # 2.0.11-1ubuntu1.2 on Ubun # Yukart bus. Local only: displays reach it through svc-gw, never directly. listener 1883 127.0.0.1 allow_anonymous true +set_tcp_nodelay true ``` `systemctl enable --now mosquitto`. It listens on `127.0.0.1:1883` only, so @@ -30,6 +31,9 @@ reach it. `persistence true` (`/var/lib/mosquitto/`), so after a reboot the broker hands out the last values from before it. svc-gw therefore treats a value known only from a retained copy as stale until a live one arrives. +- **`set_tcp_nodelay true`** turns Nagle's algorithm off for the broker's + sockets. Without it, small messages to subscribers wait for the previous + one's ACK: a 40 ms tail at raw CAN rates (svc-core `BUS-BENCH.md`). - Units that use the broker order themselves `After=mosquitto.service` and nothing else, and reconnect by themselves when it restarts. - Startup tier 1 (project-yukart `docs/ORIN-RUNTIME.md`). @@ -43,6 +47,8 @@ once a second; `svc-gw` subscribes and serves it to the tablet. Watching it: mosquitto_sub -v -t 'yukart/#' ``` -## Not checked yet +## Throughput -- Throughput at raw CAN rates (`yukart/can/raw`, ~1000–3000 frames/s). +Raw CAN rates are fine: a saturated 500 kbit/s bus (~4,400 frames/s) lost no +frames, per frame or batched; batched it costs the broker about 1 % of a core. +Measured 2026-10-12, svc-core `docs/impl/reports/BUS-BENCH.md`.