Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27927

Maximum thread cache byte limit should change based on number of connections

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.4.2, 3.5.2
    • None
    • Fully Compatible
    • Platforms 2018-01-01

    Description

      Currently, a mongos instance will attempt to cleanup memory from a thread's cache during threadStateChange() if the thread's cache size is larger than 10,000 bytes. This number was chosen heuristically based on having no more than 1,000 clients connected to a mongos instance. If there are more than 1,000 clients, then the cleanup code is run far more often. This is also problematic as the mongos logs a debug message every time the cleanup is performed.

      The suggested improvement is to adjust the maximum thread cache size value based on the number of currently active client connections.

      The code that this change relates to is located in https://github.com/mongodb/mongo/blob/r3.4.2/src/mongo/util/tcmalloc_server_status_section.cpp#L68-L86

      Attachments

        Activity

          People

            mark.benvenuto@mongodb.com Mark Benvenuto
            andrew.young Andrew Young
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: