← Blog

· 11 min read #rust#mqtt#iot#unikernel#performance#mosquitto#open source

urMQTT 0.5.0 against Mosquitto, second round: the ARM machine flipped, and the broker now speaks MQTT 5

The same two rented VPSes, the same suite and the same Mosquitto 2.0.21 as in the first comparison, now with the urMQTT v0.5.0 release: publisher back-pressure, a receive interrupt, a repaired QoS 1 sending side, and QoS 2, MQTT 5 and WebSocket. Where it moved, where it did not, and what is still wrong with the numbers.

The short version. Last time urMQTT was clearly ahead of Mosquitto on a 4-vCPU x86_64 VPS and clearly behind it on a 2-vCPU ARM64 VPS, where one core does the network card, TLS, the broker and the dispatching. We named three fixes. They are in the release v0.5.0, and we measured again, on the same two machines, with the same suite, with each machine loaded from the other. On the ARM machine QoS 0 delivery went from 47,000 to 174,000 messages a second with sixteen publisher and subscriber pairs, against Mosquitto's 58,000. On the x86 machine it went from 125,000 to 205,000, against 60,000. QoS 1 is ahead on both machines. New mutual-TLS connections per second are three times Mosquitto's on x86.

The same release also adds what was missing next to Mosquitto: QoS 2, MQTT 5 (including shared subscriptions) and MQTT over WebSocket. Those are features, not benchmarks, and they are at the end.

And the paragraph that has to stand right next to it. The ARM handshake figure did not improve and is too noisy to rank, the receive interrupt was not confirmed active on that machine in this run, and a few cells are slightly behind Mosquitto or behind our own previous build. All of that is below, in the order of how much it should change your mind.

What changed since the last text

Three things, each recorded as a decision in the repository.

  1. QoS 1 sending side repaired (ADR-268). The TCP sending side we added for the first comparison detected loss from the acknowledgements of the whole connection. With one core, a busy peer and many flows that produced spurious retransmissions and made QoS 1 slower than the release before it. Loss is now detected in the flow's own segments.
  2. Publisher back-pressure (ADR-269). When a QoS 0 message has a single subscriber and that subscriber cannot keep up, the broker stops reading the publisher for a bounded time (500 ms at most, then a 2 s cool-down), the way Mosquitto does through TCP. Before, urMQTT kept reading and dropped for the subscriber, which is legal for QoS 0 and which burned the one ARM core on messages it then threw away. The default mode is single, and it is a configuration setting.
  3. A receive interrupt instead of polling (ADR-270). The dispatcher on core 0 used to poll the network card every 200 µs while connections existed. Now the receive queue's interrupt wakes it (MSI-X, or the platform's equivalent), after a probation that checks the interrupt really arrives; if it does not, the poll stays as the fallback.

How it was measured

Exactly as before, so that the old and new numbers sit in the same figures: a Contabo x86_64 VPS (4 vCPU AMD EPYC, KVM) and a netcup ARM64 VPS (2 vCPU Neoverse N1), each loaded from the other with our urmqtt-loadgen, mutual TLS 1.3 with a client certificate on every connection, no resumption, three repetitions, median and min-max. Four brokers on each machine: Mosquitto 2.0.21, urMQTT v0.4.2, the intermediate build with the new sending side that we measured last time, and urMQTT at the commit e053399 (an ancestor of the v0.5.0 tag). The suite is scripts/x11-bench.sh, the figures come from scripts/x11-charts.py, and the raw files are in docs/perf-results/x11-2026-11-07/.

One thing is different and it matters: the Mosquitto and the older urMQTT numbers are from 7 and 8 November, the v0.5.0 numbers from 8 and 9 November. We did not re-run Mosquitto. The machines are shared hosts, so a day-to-day shift is possible; the generators reported low steal in all runs (0 % on netcup, 2 to 9 % on Contabo), which is the evidence we have that nothing large moved.

The charts

Every figure has the two machines side by side on one scale, the same colour for the same broker everywhere, the median as the bar or the point and the min-max of the three runs as the whisker or the band.

Messages delivered per second under flood: publishers send as fast as the broker accepts, the bars are what arrives at the subscribers. Four brokers per machine.
Messages delivered per second under flood: publishers send as fast as the broker accepts, the bars are what arrives at the subscribers. Four brokers per machine.

Throughput under flood is where the ARM machine flipped. With sixteen QoS 0 pairs it is 174,000 delivered a second against 58,000 for Mosquitto; the release v0.4.2 was at 47,000 and the intermediate build at 44,000, and the broker now delivers 95 % of what the generator publishes where it delivered a quarter before. The same cell on x86 is 205,000 against 60,000, up from 125,000. Fan-out from one publisher to a hundred subscribers is 239,000 against 86,000 on ARM and 289,000 against 106,000 on x86. QoS 1 with sixteen pairs is 26,000 against 15,000 (ARM) and 26,000 against 19,000 (x86); with sixty-four pairs 64,000 against 20,000 (ARM) and 58,000 against 30,000 (x86). Two cells are not wins. At 1 KiB, QoS 0, the machines are at the same 21,000 to 22,000 a second as before, which looks like the network path and not a broker. And on x86 with sixty-four QoS 1 pairs the intermediate build was higher (69,000) than v0.5.0 (58,000); the ranges overlap, but we do not claim v0.5.0 is faster than that build there.

One TCP flow, one publisher and one subscriber, three message shapes.
One TCP flow, one publisher and one subscriber, three message shapes.

One flow is the hardest case for urMQTT, because there is no parallelism to hide the latency of its own work. On ARM, 64-byte QoS 0 went from 12,000 to 156,000 a second, Mosquitto being at 49,000; on x86 from 54,000 to 97,000 against 51,000. QoS 1 over one flow is about 2,000 delivered a second on both machines, twice Mosquitto's, but that is a rate limited by round trips (the generator is 12 ms away), not by either broker. With 1 KiB QoS 0 on x86 Mosquitto is slightly ahead (12,000 against 11,000, ranges overlapping).

New mutual-TLS connections per second as the generator's concurrency grows from 32 to 128 threads.
New mutual-TLS connections per second as the generator's concurrency grows from 32 to 128 threads.

Handshakes, what a fleet does to a broker after a power cut. On x86 it is 1,960 a second at 128 concurrent clients against 639 for Mosquitto, and our TLS part takes 35 ms against 130. That is the same as the intermediate build and 7 % above v0.4.2, so the three changes did not touch it, which is what we expected. On ARM the figure is not usable for ranking. The 64-thread cell is 1,281 against 409 for Mosquitto, the 128-thread cell is a median of 757 with runs from 366 to 1,501, and the 99th percentile of connection time at 128 threads reaches 961 ms in one run. We saw a tail of about 1.1 s in the intermediate build last time and we have not found its cause; v0.5.0 does not show it consistently, which is not the same as having fixed it.

Messages delivered at a steady offered rate, QoS 1.
Messages delivered at a steady offered rate, QoS 1.

At fixed rates, which is how devices actually publish, there is no contest to report and nothing broke. On ARM at 1,000 messages a second per pair (16,000 in total) v0.5.0 delivers 15,500 QoS 1 messages a second with a p50 of 12 ms; the intermediate build was at 8,800 delivered at that rate. At 100 and 300 a second per pair every broker keeps up, and the interesting number is latency.

End-to-end latency (p50) as the offered rate grows.
End-to-end latency (p50) as the offered rate grows.
Broker CPU while delivering.
Broker CPU while delivering.
Memory in use with 5,000 to 20,000 idle mutual-TLS connections.
Memory in use with 5,000 to 20,000 idle mutual-TLS connections.

Memory is where we are not uniformly ahead. On ARM urMQTT holds 5,000 idle mutual-TLS connections in 3.8 MB of heap and 20,000 in 10.7 MB; Mosquitto's resident size at 5,000 is 4.9 MB. On x86 the urMQTT kernel starts at 9.5 MB (per-core structures for four cores) and is at 10 MB at 5,000 connections, twice Mosquitto's 4.9 MB at the same point; at 20,000 it is 17.8 MB. We did not measure Mosquitto at 20,000 in this session.

What is wrong with each of these numbers

Caveats are what make a comparison usable, so here they are in order of importance.

  • The receive interrupt was not confirmed on the ARM machine. The broker counts how often the dispatcher slept armed on the interrupt, and on netcup in the v0.5.0 run that count was zero, which means it ran in the fallback mode (or the counter does not say what we think; we did not capture the boot log of that run). So the ARM improvement above comes from the other two changes, mainly back-pressure, and the interrupt is unproven on that platform. On x86 we did not look at the counter either. Treat the interrupt as an open item, not as a result.
  • We did not separate the three changes. The measurements compare releases and builds, not each change alone. The attribution above (back-pressure for the QoS 0 jump, the loss detection for QoS 1) comes from the design and from the counters, not from an ablation run.
  • Mosquitto was not re-run. See above: one to two days apart, same machines, low steal. The Mosquitto cells are the same files as last time.
  • "Delivered" and "accepted" are still different things. With back-pressure on, urMQTT delivers 95 % of what the generator offers in the QoS 0 case. In the QoS 1 floods it still delivers about half of what it acknowledged from the publishers (for example 26,000 delivered against 55,000 acknowledged with sixteen pairs on ARM): the per-subscriber queue is bounded and the rest is counted as qos1_queue_full. That is allowed by the specification for a subscriber that cannot keep up, and it is not what Mosquitto does, which slows the publisher down instead (and shows 800 ms p50 latency doing it). Which behaviour you want is a design choice, not a score.
  • Two machines, three repetitions, one generator each. The spread within a session is what the whiskers show. The ARM VPS is a shared host and has shown 2.5 times differences between days in the handshake test.
  • The generator was a limit in some cells. On x86 the 128-thread handshake generator was at about 1.8 of its two cores. Those urMQTT figures are floors.
  • The earlier text had one wrong explanation, now corrected there. It said that frames/dropped/nic counted receive-queue overruns on the ARM card. It counts frames dropped because the transmit queue was full. The conclusion about queue depth in that text was drawn from the wrong counter; this one does not depend on it.
  • Fan-out to a thousand slow subscribers is still a weak spot on one core: 9,300 of 10,000 messages a second delivered with a p50 of 208 ms on ARM, where Mosquitto delivers 9,800 at 56 ms.
  • Memory is heap against RSS. For urMQTT the heap in use is the whole truth; Mosquitto's RSS includes retained allocations.

The release itself

v0.5.0 is signed (minisign key 721316B961DCB94B), comes with SLSA provenance attestations and a CycloneDX SBOM, and is marked a pre-release: urMQTT is alpha. Four things to know before upgrading from v0.4.2. The configuration format is now 13 and v0.4.2 refuses it. The store schema is 5, and the migration from the old one is one way, so back the store up first. Persistent sessions now expire after 30 days offline by default, where they were kept forever. And the kernel is reproducible from the tag only with the runner's clang (18.1.3); a build on a Mac with a newer clang gives a different file, which we found while verifying this release and have written into the release notes.

New in this release next to the performance work:

  • QoS 2, exactly once (ADR-271).
  • MQTT 5 beside 3.1.1 on every listener: reason codes, session and message expiry, properties, flow control, topic aliases from the client, shared subscriptions and subscription identifiers. Only enhanced authentication is refused.
  • MQTT over secure WebSocket (wss://) in the kernel, off by default.

What we take from it

The first comparison said the design wins with cores to use and loses on one core because that one core is spent on the wrong things. The fixes for that were back-pressure and the receive path, and the numbers say the first of them worked: on one ARM core the broker now moves three times Mosquitto's QoS 0 traffic and two to three times its QoS 1 traffic. The handshake figure on that machine and the interrupt are the two things we do not yet understand well enough, and the next measurement will start with them.

The method is in the repository: scripts/x11-bench.sh, scripts/x11-mosquitto.sh, scripts/x11-report.py, scripts/x11-charts.py, with the raw files of both comparisons in docs/perf-results/x11-2026-11-07/ and the tables in docs/PERFORMANCE.md. urMQTT is alpha. These numbers measure a specific kernel on two specific rented machines on three days; they do not measure maturity in production.

Comments

Comment rules

Comment rules

Comments are here to share experience and questions about the topics of the blog. These rules keep the discussion useful for everyone.

  1. Be civil No insults, threats, harassment, hate speech or discrimination on any grounds. Criticise the argument, not the person.
  2. Stay on topic A comment should relate to the post or to the discussion under it.
  3. No ads or spam No advertising, chain messages or links without context. Links and images are welcome when they add to the discussion.
  4. Others' privacy Do not post other people's personal data: full names of private individuals, addresses, phone numbers, emails, photos without consent.
  5. Copyright Post only content you are allowed to share. When quoting, name the source.
  6. One identity Use one nickname and do not pose as someone else.
  7. Email confirmation A comment is published only after you confirm the link sent by email. The address is not shown and not used for anything else; unconfirmed comments are deleted after 48 hours.
  8. Moderation Comments that break the rules are hidden or deleted without notice, and a discussion may be locked. Moderators' decisions are final.
  9. Responsibility The author is responsible for the content of a comment. Comments do not reflect the views of ALDO TECH.
  10. Reporting Report inappropriate content to info@aldo.tech.