Reconnect schedules can cause a thundering herd when a relay restarts
A device agent stacks two reconnect schedules: the socket library's own backoff and an outer loop in the agent's main process. A clamp in the library's backoff code pushes many jittered delays up to a fixed value, so devices can retry in lockstep. Devices whose session tokens have expired must also call the /init endpoint, where random 5 to 60 second waits are meant to spread load. The outer loop rebuilds the connection on a 60-second tick and backs off to 30 minutes after five rebuilds. The author notes they have not measured a real relay restart and makes no claim about its outcome.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in