Why is my EC2 server's time off by ~10 seconds every day?
There are a number of factors that might make a software clock run slow or fast. Clocks on virtual servers are especially prone to a whole class of these problems. 12 seconds a day is pretty bad until you come across virtual boxes with clocks that run at 180–200% speed! Clocks on laptops that suspend can suffer from time-keeping issues too.
You should consider dropping ntupdate
in favour of ntpd
. The package name is ntp
on Debian (and presumably Ubuntu too). The NTP daemon keeps your time in sync a lot more proactively than a cron job, synchronising with one or more other NTP servers and keeping your clock much more accurate. It's another implementation of the same protocol ntpdate
uses, except ntpd
monitors the time continuously.
If you don't want the (very small) overhead of ntpd
, you might consider running ntpdate
once an hour. Assuming you're 0.5s off every hour, that should be sufficient.