Wednesday, June 6, 2012

Amazon EC2 Instances Times differ Considerably

So, I'm running uBuntu instnaces on Amazon's EC2 for a time critical application. When these were first started they had the same time... But after few days there has been more than 5 minutes time difference between both the instances.

This happened because by default these instances have not been configured to update time from NTP Servers. So to get around this problem I have to either manually run the command: 

sudo ntpdate

which will actually sync up the instance time with a network Time Server. 

To answer from where did the time difference came - Actually when rebooting the instance the time it took to reboot it each time got accumulated and hence resulted into a total 5 min difference in my case. So each time you reboot your instance time would get back by that amount. 

To permanently fix this problem we would need to sync up times on every restart.

1 comment:

  1. Thanks for the tips. Great blog, you really explain things well.

    -The Anon Blogger