1

I have two separate AWS Virtual Machines set up within a region (different availability zones) both are connected via WebSocket (in Python) to a different load balancer (Cloudfront) of the same host server (also hosted with AWS) and receive frequent small WebSocket payloads - every 5ms.

Both machines are receiving the same updates and I would like to measure on which machine the updates/payloads/packets are arriving first

In essence I would like to figure out which load balancer is "closer" to the host and so has the least latency overhead in transmitting the signal since my application is highly latency sensitive.

Huw Thomas
  • 141
  • 1
  • 4

1 Answers1

0

Consider using AWS Time Sync Service and logging packet arrival times, comparing logs later.

For starters, though, just log packet arrival times, and use normal NTP admin commands on the instance to check "root dispersion", which is an estimate of the time error between the instance and the root time server. Most likely those are under a millisecond, so if the difference in arrival times is greater than the sum of the two root dispersions, you don't need the Time Sync Service.

Actually, if the two instances share any NTP server in their chain of servers up to the root time server, you can use the dispersion from that shared server.

I'm assuming ECS instances run NTP by default, which IIRC is correct but I'm not certain.

When logging packet arrival times, I'd include the local time explicitly in the message just to be sure, but IIRC that's pretty much the same as the timestamp you'd get in Cloudwatch logs.

Jeff Learman
  • 207
  • 1
  • 2
  • 9