smartrent / tortoise311

An MQTT 3.1.1 Client written in Elixir
Apache License 2.0
11 stars 8 forks source link

Add jitter to exponential backoff delay #16

Closed fhunleth closed 2 months ago

fhunleth commented 2 years ago

Currently the code doubles the delay before reconnecting after each failed attempt. Ops would like a random amount of time to be added to this as well. The goal is to smooth out the load on the server if many devices start reconnecting at the same time. Barring a better amount, how about picking a time between 0 ms and 25% of the current delay to add?