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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.2, 3.5.2
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Platforms 2018-01-01

      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

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

              Created:
              Updated:
              Resolved: