Reduce the overhead of query stats rate limiter

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This component shows up in collected samples for YCSB 100% read, and disabling it by applying the following patch to v8.2 shows meaningful performance gains:

      src/mongo/db/query/query_stats/query_stats.cpp
      diff --git a/src/mongo/db/query/query_stats/query_stats.cpp b/src/mongo/db/query/query_stats/query_stats.cpp
      index 7597adcb1ca..5f732f7bef3 100644
      --- a/src/mongo/db/query/query_stats/query_stats.cpp
      +++ b/src/mongo/db/query/query_stats/query_stats.cpp
      @@ -348,10 +348,14 @@ void registerRequest(OperationContext* opCtx,
               return;
           }
       
      +    /*
           if (!shouldCollect(opCtx->getServiceContext())) {
               opDebug.queryStatsInfo.disableForSubqueryExecution = true;
               return;
           }
      +    */
      +    opDebug.queryStatsInfo.disableForSubqueryExecution = true;
      +    return;
       
           if (opDebug.queryStatsInfo.key) {
               // A find() or distinct() request may have already registered the shapifier. Ie, it's
      

      In particular, the rate limiter uses a mutex that appears to be serializing requests:

              Assignee:
              Unassigned
              Reporter:
              Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: