Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3648

RTT measurements are inaccurate on Windows

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Server Selection
    • None

      RTT measurements on Windows are inaccurate because we rely on time.monotonic and time.time which have low resolution. See https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-gettickcount64#remarks:

      The resolution of the GetTickCount64 function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds. The resolution of the GetTickCount64 function is not affected by adjustments made by the GetSystemTimeAdjustment function.

      If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.

      This can be problematic in Windows because:

      1. RTT affects server selection with the default localThresholdMS of 15ms.
      2. RTT affects the behavior with CSOT, as seen in PYTHON-3522.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: