Integration / D Bus Interview Questions
How can you optimize a system with heavy D-Bus signal traffic?
A system emitting a large volume of D-Bus signals, such as frequent property updates from many devices, can start to strain both the bus daemon and every subscriber processing traffic it doesn't actually need, so optimization targets both the emitting and the receiving sides.
- Narrow match rules aggressively. Subscribers should filter on sender, interface, and path rather than subscribing broadly and filtering in application code after delivery, since a narrow match rule avoids the bus daemon delivering unneeded messages at all.
- Batch or debounce frequent property changes. Emitting a PropertiesChanged signal on every tiny update can flood the bus; coalescing rapid changes into fewer signals reduces both bus load and subscriber processing.
- Prefer dbus-broker over the reference dbus-daemon for its more efficient signal dispatch under load.
- Reduce broadcast scope by moving very chatty, high-frequency data off D-Bus entirely and onto a more specialized channel, using D-Bus only for occasional state-change notifications rather than a continuous high-rate stream.
- Profile with dbus-monitor and busctl to actually identify which sender or signal is dominating traffic before optimizing blindly.
More Related questions...