Optimize backpressure flag in serverStatus for better performance

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Workload Resilience
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      https://jira.mongodb.org/browse/BF-45939 reported server_status_locust measured performance drop with backpressure flag change. 

      Optimizations to consider

      • The 1k can probably be cut in half in the normal case when there's only one session manager (I think we have to loop because of the possibility of GRPC but in production it never actually happens). Another way to do this is to return a non-atomic-backed version of BackpressureConnectionMetrics when creating serverStatus instead of using the same type for recording and reporting the metrics.
      • Only some of the atomic loads use relaxed ordering, but given this is for stats perhaps more can.
      • The other straightforward optimization is to only store and load counts for backpressure versions we actually see, assuming we expect this number to be small.

       

       

            Assignee:
            Jiaqi Tian
            Reporter:
            Jiaqi Tian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: