Is the time synchronized across multiple dynos on Heroku?
Asked Answered
A

2

7

Is there any article on how synchronized are the times across multiple dynos in heroku, and how reliable they are?

I am running a node.js application on Heroku and need to know if the time that I get using Date.now() or new Date() is synchronized across multiple dynos?

  1. Using cluster module, it seems that all the processes running on the same dyno have the same time. Do they use the local machine time or a clock server?
  2. I tested with two dynos in the same app to print the timestamp as soon as they start and they seemed to have the same time. Is this reliable?
  3. I did not test with dynos on different apps. Are they likely to have the same time or in a reliable difference range?

By the same time, i mean the time differences were less than 1000ms, which can be due to slightly difference process staring times.

Atabrine answered 10/10, 2014 at 18:11 Comment(1)
In order to test this, you need an external reference point. You could test for desynchronization across machines by logging time and skew after syncing with an NTP server, for example. You cannot trust log output time to do this measurement.Burgos
L
1

I don't think so and I don't think it's reliable.

The post How do I establish clock synchronization in the cloud (AWS, heroku, etc) across many nodes? have some good general information both in the question and answer about NTP, virtual machines and the cloud.

Lucialucian answered 27/5, 2015 at 21:44 Comment(0)
F
1

This is a little late, but YES, Heroku dynos have synchronized time.

Screenshot of the Support Ticket: Support ticket

NTP is pretty accurate too, and 1000ms is definitely within NTP's range.

Freezedry answered 9/8, 2015 at 21:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.