jamesmillerio
jamesmillerio

Reputation: 3204

Dealing with an inaccurate system clock

I have a windows based system that sits on an Amazon EC2 instance. There is a known issue that Windows EC2 instances have problems keeping their system time in sync. I'll randomly log into the system and find that my system clock is anywhere from a couple seconds off (not too big of a deal...) to several minutes or even hours off (obviously a huge deal).

Considering that my site's prime objective is to issue out links to secured S3 content that is locked down by a considerably strict time limit (ie sometimes as little as 30 seconds to a minute), this is a huge issue for me. Scouring Amazon's help forums has yielded many answers that simply do not work and Amazon seems to be ignoring the issue claiming it's Windows related. Regardless, I've decided to take things into my own hands and not to wait on Amazon.

Things I've considered:

Are there any other options you can think of that I may have missed? I'm not really opposed to anything with the one exception being rewriting my site in another language so as to move away from Windows (it's a .Net MVC application currently).

Thanks in advance!

EDIT: Also of note, I can not use referrer based security as the plugins I'm utilizing that use these links don't 100% send the referrer in some browsers.

Upvotes: 5

Views: 1428

Answers (4)

Arindam Nayak
Arindam Nayak

Reputation: 7462

changed internet time server to "time.nist.gov", it corrected time.

Upvotes: 0

TomPed
TomPed

Reputation: 1

I have been dealing with the same problem for weeks and found out the root of my problem was simple:

Make sure your Network ACL allows inbound UDP traffic.

Upvotes: 0

friism
friism

Reputation: 19279

It's strange that your servers should drift several hours. By default, Windows Server 2008 R2 is configured to NTP-sync its clock with time.windows.com every 900 seconds (15 minutes). If this does not get you the required timeliness, you can increase the frequency by modifying a registry key.

If you're hosting a ASP.NET application, you should consider running it on AppHarbor. We run on top of of EC2, but take away dreary server management tasks like making sure clocks are in sync.

Upvotes: 3

totallyNotLizards
totallyNotLizards

Reputation: 8569

you could try making an app on either your windows instance or a linux instance if you choose to go that way, and whenever you need to know what the time is send an api request to somewhere like this: http://worldtimeengine.com/api/ to get the current local time.

if you can't rely on the clock of the instance then get the time from somewhere else :)

Upvotes: 0

Related Questions