-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTTs can be highly inaccurate on Windows #14
Comments
It seems to be worse when using lower intervals. When locking goroutines to OS threads with Negative RTTs should obviously be impossible, and this occurs because the measured server processing time may sometimes be greater than the measured round-trip time when there's this level of clock inaccuracy. I worked around this problem by not subtracting the server processing time if this is the case, but the inaccurate RTTs remain. |
The current status for me is that the negative RTTs are taken care of by the new highPrecisionTimer flag. I can still see 0 RTTs when connecting to a server on localhost, which is probably when we reach the limits of the Windows timer. When 32-bit Win 10 is running on VMWare, I see RTT jumps as follows (it's about a 16ms RTT to the server):
I do not see these same jumps with 64-bit Win 10 on a physical box:
|
Testing in low latency (64bits VM less than 1ms latency) gets 0 pretty much all across. Any way to get accurate timings in Windows? seq=0 rtt=1ms rd=-9.01ms sd=10.01ms ipdv=n/a |
What is ping's average mean RTT on this link? I guess in Windows you'd see "<1ms" but Linux or OS/X would be needed for anything more precise. I'm not sure if I can improve on this. Either I can find something else with the Windows timer APIs, or I'll have to change the display to something similar as Windows ping does (<1ms). I won't be able to take a look until next week, but meanwhile any tips are appreciated... |
Ok, I'm optimistic that I can replace the monotonic clock values with calls to QueryPerformanceCounter / QueryPerformanceFrequency from kernel32.dll. In case you get a chance to try
I'm hoping not to see any zeroes, and for the mean elapsed time to be in the sub-microsecond range. It will be more expensive calling into the dll like this, but looks like it will be far more accurate, if it tests out ok when calling from different goroutines, etc. |
Hi Pete, I'll give it a spin today and let you know. Thanks! |
Thanks, and an update is attached so run this one instead. It looks like Go's standard time implementation isn't precise enough for the wall clock either, so I'll have to use GetSystemTimePreciseAsFileTime instead, which is now included in the test, along with a test of Go's standard time, which seems to quantize to 1ms.
|
Please give irtt a try on Windows again in your environment as I just integrated support for QueryPerformanceCounter and GetSystemTimePreciseAsFileTime. I'll be glad to hear if it works on a low RTT network with 64-bit Windows, but the results are looking much better for be now (see below). Thanks!
|
I also tested this on a physical box with 64-bit Windows and the results look good. Note that it's possible to see a 0 IPDV value because the resolution is 100ns when it's 1ns on Linux, for example, but that's not a significant problem. |
The Windows client can show round-trip times that are zero or even negative, regardless of whether the wall or monotonic clock values are used (tested on VMWare Win 10 32-bit, Go 1.10.2).
The text was updated successfully, but these errors were encountered: