Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the time synchronized across multiple dynos on Heroku?

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.

like image 720
nvd_ai Avatar asked Oct 10 '14 18:10

nvd_ai


People also ask

How many dynos do I need Heroku?

Standard-2x dynos offer the best combination of price and performance for most apps. If you encounter memory quota warnings on 2x dynos, you should make the jump to Performance-L. For either dyno type, autoscaling is the only way to know how many dynos you should be running.

How are dynos calculated Heroku?

Free dyno hours are calculated whenever a free web dyno is running and we stop calculating when the free web dyno goes to sleep. (If a free web dyno doesn't receive a request for 30mins it will "sleep" so we will no longer count towards the quota until a request is made and the free web dyno boots again.)

How does Heroku automatically restart dynos?

Automatic dyno restartscreate a new release by deploying new code. change your config vars. change your add-ons. run heroku restart.

How many cores does a Heroku Dyno have?

vCPU count In this case performance-l dynos have 4 physical cores and 4 hyper threads.


1 Answers

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.

like image 200
dentarg Avatar answered Oct 29 '22 23:10

dentarg