FlashMQ version 1.9.0 introduces several mechanisms to prevent overloads by clients subscribing to broad wildcard topics. There are two causes of load:
- If you have a base message load of 100,000 messages per second, each client subscribing to # causes that many permission checks per second. If you have 100 clients doing that, there will be 10 million permission checks per second.
- If you have a large tree of retained messages, a subscription to
#means all the nodes of the trees are searched for messages. There already is the config optionretained_messages_node_limit, but that results in aborting the process at a random point.
The following abilities have been added to control this:
- The options
minimum_wildcard_subscription_depthandwildcard_subscription_deny_mode. With it, you can prevent subscriptions to something like#orsensors/+/temperature. To allowone/two/three/#, specify 3 as minimum value. The deny mode specifiesdeny_allordeny_retained_only. - The plugin has the ability to return
success_without_retained_deliveryon a subscription. This allows the subscription to work, but without attempting to deliver retained messages.
Downloads available as usual.