Commit Briefs

05867825af Tracey Emery

describe worker count and congestion in mqttctl.8 (tags/1.1.0)

"show parent" now reports the number of sockets workers and "show clients" marks a connection that is not draining as congested and counts the messages dropped for it; say so in the manual.


1ac677f7e9 Tracey Emery

start under a dedicated login class

Every client connection costs one descriptor in one sockets worker, and each process raises its open file soft limit to the hard limit of the login class the rc script started it under. Until now that was the stock daemon class, so client capacity was whatever its default happened to be. Ship /etc/login.conf.d/mqttd, start the daemon under that class from the rc script, and document the sizing rule: about workers times the class maximum, with kern.maxfiles raised to match.


4af73d3b7a Tracey Emery

per-connection backpressure for slow subscribers

A sockets worker now tells the broker when the bytes queued for a connection pass the maximum packet size, and again when they have drained. While a connection is congested the broker drops QoS 0 for it, counting the drop against the session and the broker totals, and parks QoS 1 and 2 in the session queue under the existing "max queued" limit; delivery resumes on drain. Retained messages owed to a new subscription are still written, as [MQTT-3.3.1-9] requires. Until now a subscriber that stopped reading accumulated output until the worker cut it off at four times the packet size. For a Sparkplug primary host that disconnect means a reconnect and a fleet-wide rebirth, so the broker now sheds load per connection first; the overflow disconnect stays as the last resort. "mqttctl show clients" shows the congested state and the per-client drop count.


a8f2d00fef Tracey Emery

split accept into a listen process and sockets workers

A new listen process owns the listening sockets. It accepts, consumes the PROXY protocol header where a listener expects one, dials outbound bridges, and hands every connected descriptor to the sockets worker with the fewest live connections. The workers only ever receive connected descriptors, so they run under pledge "stdio recvfd" and never call socket(2), accept(2) or connect(2). Connection ids are global, listener connection counts and "mqttctl show listeners" come from one process, and bridges are no longer pinned to a process at configuration time. "workers" in mqttd.conf sets the pool size (default 2, maximum 32); "prefork" stays as a deprecated alias. The broker keeps one pipe per worker and still routes by the pipe a connection arrived on. A listener added on reload reaches the workers before listen starts accepting on it, and a worker sets a listener's TLS context up on first use in case a hand-off still overtakes the parent's start message.


8507d3d5b7 Tracey Emery

run a single sockets process

Drop the prefork pool of sockets processes. Connections are long-lived, so balancing them once at accept() across N processes by kernel lottery never rebalanced anything, and every listener-scoped fact (per-listener connection counts, bridge placement, mqttctl show listeners) had to be summed over N. The parent, broker and control each talk to one sockets pipe now. "prefork" in mqttd.conf is still parsed and logs a deprecation warning. The broker keeps its per-process routing index so the coming listen/worker split does not touch it again.


605bf9f121 Tracey Emery

Initial import (tags/1.0.0)