1

I have a process whereby a message goes through a whole stack of services. For example; message 'x' is sent through system 'A' followed by system 'B' followed by system 'C'. All services are hosted on different machines. I want to know how much time has passed from the instance in which the message was created up to the time at which it was consumed by 'C'.

To do this, every service sets its timestamp in the message 'x' which is going through the system.

Of course, to be able to attain this all servers must have their time synchronised.

I have discovered it is not so easy to keep them exactly in sync (note that it typically takes 30ms for message 'x' to get from A to C). In my latest attempt I have created a cron job which runs 'ntpdate -u 0.europe.pool.ntp.org' every minute on all servers. This is however failing since I am getting negative numbers in my reports (which would mean that I received the message even before it was published :))

Can anyone provide some help with this?

Kros
  • 848
  • 1
  • 10
  • 24
  • You could try switching to PTP/IEEE1588. It is very accurate. [link]http://linuxptp.sourceforge.net/ <== but i think this is quite old. There are newer versions. Maybe it's even in the kernel now. But seeing the results you are getting, It almost seems as if your there is some big error in your system clocks. – JHBonarius Feb 15 '17 at 16:23
  • Run the ntp daemon, that won't slam your clock around like ntpdate does. – Ciclamino Feb 15 '17 at 16:32
  • I have set up the ntp daemon on all machines, however, results are similar to what I got. Precision must be up to 1 millisecond for my tests to make sense. – Kros Feb 15 '17 at 22:32
  • I am getting the following on Server 'A' : synchronised to NTP server (212.18.3.19) at stratum 3 - time correct to within 328 ms - polling server every 1024 s and the following on Server 'B' : synchronised to NTP server (131.234.137.64) at stratum 2 - time correct to within 129 ms - polling server every 1024 s – Kros Feb 16 '17 at 09:11

0 Answers0