Clock drift on servers: do you monitor time sync or just trust it?
We had a strange bug where auth tokens were rejected as "not yet valid" on one machine. Its clock was off by a couple of minutes because time sync had quietly stopped working.
Now I'm wondering whether to alert on clock offset. Do you monitor it, or is it one of those things that only matters once it bites you?
Comments · 4
I didn't know servers could drift enough to break logins. What's the usual fix, a time sync service running on every machine?
Yes, a time sync daemon such as chrony or systemd-timesyncd on each machine, pointed at reliable NTP servers. The real lesson was to alert if it stops working.
Monitor it. A drift alert is cheap and the failure mode is nasty, since the symptoms look like random auth bugs that eat engineering days.
Run chrony or systemd-timesyncd, and alert if the offset passes a threshold, like 100 ms. Allow small clock skew in token validation too.