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

$regex may use unbounded cpu and memory

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • ALL
    • Service Arch 2023-10-30

      Once the server admits a regular expression operation and hands it over the PCRE engine we no longer have control over its resource utilization. This can break the cloud QoS implementation by preventing feedback from the mongod from being integrated in request throttling in the router, but also may result in a noisy neighbor problem on the mongod.

      Two possible mitigations were discussed:

      • Perform regex matching on a dedicated thread with a low priority (see nice)
      • Use  pcre2_set_match_limit to "page" regex results. Each time we reach a limit would be an opportunity to yield the matching to re-engage with execution control

            Assignee:
            shameek.ray@mongodb.com Shameek Ray
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: