How accurately are aws clocks synchronized between different aws regions?
According to the wikipedia NTP article, NTP is accurate within 10ms over public internet.
I would like to maintain accuracy of logs/events across different AWS regions and my question is how accurately are the AWS clocks synced between the different regions?
Solution 1:
Configure ntpd to point to the usual sources, but also peer with the ntpd you are running in other regions. Enable statistics. You now can record the offset of instances in different regions.
Do not expect sub 10 ms error or so between regions. The latency between regions, or to distant public NTP servers, makes that difficult.
Your requirements are probably not as extreme as one of the most distributed databases, Google Spanner. They developed a time service just for inter-datacenter databases, added hardware atomic clocks, and still I think ε was in the single digit ms.
Solution 2:
Update - this answer is out of date. See this blog post for more recent information.
AWS doesn't sync clocks across regions.
AWS doesn't run an NTP service / server, external NTP servers are used. NTP accounts for latency.
I imagine AWS runs fairly standard servers. Their internal clocks should be as accurate as any server.
So long as you have NTP configured to run, and you've allowed access to NTP servers in your security groups / NACLs, all regions should have accurate time. To actually test it would take some work.
Solution 3:
Check out this link: Configuring Network Time Protocol (NTP) I would expect to see very accurate clocks in EC2, as the instance network interfaces are very stable for latency. That said, we're talking about NTP synced system clocks, which are notoriously inaccurate. I don't think you should safely rely on NTP and system clocks for anything timing sensitive.
You've responded that you're worried about "file synchronization, where collisions are costly to fix". Perhaps you should be looking into a synchronous solution like NFS/EFS.
Solution 4:
AWS launched it's Time Sync Service shortly after these answers were supplied. The link below provides details on how you can sync, monitor and alert on time drift in AWS: https://aws.amazon.com/blogs/mt/manage-amazon-ec2-instance-clock-accuracy-using-amazon-time-sync-service-and-amazon-cloudwatch-part-1/