The mqtt ordering is solved from my point of view, by using “Disable frame-counter validation”, and max_in_flight.
THe global aim of this stuff, is to be able to receveived stored dataframe, when Inet is broken. Some of our Gateways are in inet hard condition.
The result of the test of night is not to bad. but no perfect.
-
So set Mqtt Max inflight to only 1, on the local broker and the main broker (its slow down clearly the mqtt flux, which seems to be a good point for the Chirpstack server)
-
deduplication_delay=“0ms” - Override the default value (200ms)
-
Disable frame-counter validation to avoid rejected frame in case of no good order.
During the night real test on 960 expected frame, we received 882, failure rate : 8%
We have created a test bench replaying the same mqtt as mqtt message by a simple bash shell, by a sequential manner, and by a multiprocesse manner, to do some stats and experimentation.
Sequential :
mosquitto_pub -u agspXXXXXr -P "XXXXXX" -q 1 -h <ourmqttbroker> -t aXXXXXn/ns/gateway/0080000000024764/event/up -m '{"phyPayload":"QLJcTwEAnQ4BB6JNaDro/gv1x/pzPMD0qxQuBGv2cARlUf9GBg4=", "txInfo":{"frequency":86
7100000, "modulation":{"lora":{"bandwidth":125000, "spreadingFactor":9, "codeRate":"CR_4_5"}}}, "rxInfo":{"gatewayId":"0080000000024764", "uplinkId":44220, "time":"2023-03-16T16:21:54.545889070Z", "rssi":-69, "snr":12.8, "channel":3, "rf
Chain":1, "context":"l9uIZA==", "crcStatus":"CRC_OK"}}'
mosquitto_pub -u xxxxxx -P "xxxxx" -q 1 -h ourmqtt.server.fr -t aXXXXXn/ns/gateway/0080000000024764/event/up -m '{"phyPayload":"QLJcTwEAng4Bqni6j+50Ht0ecipLGoOyFQB6sF5HJ/EPVEQmLqw=", "txInfo":{"frequency":86
8300000, "modulation":{"lora":{"bandwidth":125000, "spreadingFactor":9, "codeRate":"CR_4_5"}}}, "rxInfo":{"gatewayId":"0080000000024764", "uplinkId":9568, "time":"2023-03-16T16:22:54.499896832Z", "rssi":-67, "snr":12.8, "channel":1, "con
text":"m25YLA==", "crcStatus":"CRC_OK"}}'
Multi process :
mosquitto_pub -u agspXXXXXr -P "XXXXXX" -q 1 -h <ourmqttbroker> -t aXXXXXn/ns/gateway/0080000000024764/event/up -m '{"phyPayload":"QLJcTwEAnQ4BB6JNaDro/gv1x/pzPMD0qxQuBGv2cARlUf9GBg4=", "txInfo":{"frequency":86
7100000, "modulation":{"lora":{"bandwidth":125000, "spreadingFactor":9, "codeRate":"CR_4_5"}}}, "rxInfo":{"gatewayId":"0080000000024764", "uplinkId":44220, "time":"2023-03-16T16:21:54.545889070Z", "rssi":-69, "snr":12.8, "channel":3, "rf
Chain":1, "context":"l9uIZA==", "crcStatus":"CRC_OK"}}' &
mosquitto_pub -u xxxxxx -P "xxxxx" -q 1 -h ourmqtt.server.fr -t aXXXXXn/ns/gateway/0080000000024764/event/up -m '{"phyPayload":"QLJcTwEAng4Bqni6j+50Ht0ecipLGoOyFQB6sF5HJ/EPVEQmLqw=", "txInfo":{"frequency":86
8300000, "modulation":{"lora":{"bandwidth":125000, "spreadingFactor":9, "codeRate":"CR_4_5"}}}, "rxInfo":{"gatewayId":"0080000000024764", "uplinkId":9568, "time":"2023-03-16T16:22:54.499896832Z", "rssi":-67, "snr":12.8, "channel":1, "con
text":"m25YLA==", "crcStatus":"CRC_OK"}}' &
The results are :
- Sequential failure 0%
- Multiprocess failure 66%
Note that redis max connection have no influence at all on the failure results in multiprocess… We keep 10.