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

Resource leakage + slowness after creating and deleting few thousands of DBs

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.11
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows & Linux
    • Storage Engines
    • 5

      Creating new DB + collections + indexes and deleting it becomes slow after few thousands of cycles.

      The mongo process memory keeps growing although the DBs are deleted so only a single DB is present at any given time. At some point this cycle become more and more slower. It seems around the memory consumption of ~3.5GB.

      After stopping the script, the mongo process keeps consuming large amount of CPU and Memory (forever).
      If script will be run again, memory will get even higher and also the cycle time.

       

      See a simple script to reproduce the issue:

      https://github.com/assaf-xm/mongodb-create-drop-dbs/blob/master/test.js

       

      And results:

      https://github.com/assaf-xm/mongodb-create-drop-dbs/blob/master/3.6.11-in-memory.png

      https://github.com/assaf-xm/mongodb-create-drop-dbs/blob/master/3.6.11-regular.png

       

      At start timings are fast - 201ms:

      2019-04-17T12:11:25.645Z start 3
      2019-04-17T12:11:25.654Z connected 3
      2019-04-17T12:11:25.655Z collection 0
      2019-04-17T12:11:25.672Z collection 1
      2019-04-17T12:11:25.690Z collection 2
      2019-04-17T12:11:25.706Z collection 3
      2019-04-17T12:11:25.726Z collection 4
      2019-04-17T12:11:25.742Z collection 5
      2019-04-17T12:11:25.760Z collection 6
      2019-04-17T12:11:25.779Z collection 7
      2019-04-17T12:11:25.796Z collection 8
      2019-04-17T12:11:25.812Z collection 9
      2019-04-17T12:11:25.828Z drop collection 0
      2019-04-17T12:11:25.830Z drop collection 1
      2019-04-17T12:11:25.832Z drop collection 2
      2019-04-17T12:11:25.833Z drop collection 3
      2019-04-17T12:11:25.835Z drop collection 4
      2019-04-17T12:11:25.836Z drop collection 5
      2019-04-17T12:11:25.838Z drop collection 6
      2019-04-17T12:11:25.840Z drop collection 7
      2019-04-17T12:11:25.841Z drop collection 8
      2019-04-17T12:11:25.843Z drop collection 9
      2019-04-17T12:11:25.845Z drop 3
      2019-04-17T12:11:25.846Z finish 3 | 201

       

      But after 8800 cycles DB operations are much slower - 685ms:

      2019-04-17T12:41:20.397Z start 8800
      2019-04-17T12:41:20.402Z connected 8800
      2019-04-17T12:41:20.402Z collection 0
      2019-04-17T12:41:20.486Z collection 1
      2019-04-17T12:41:20.557Z collection 2
      2019-04-17T12:41:20.642Z collection 3
      2019-04-17T12:41:20.716Z collection 4
      2019-04-17T12:41:20.773Z collection 5
      2019-04-17T12:41:20.831Z collection 6
      2019-04-17T12:41:20.877Z collection 7
      2019-04-17T12:41:20.916Z collection 8
      2019-04-17T12:41:20.959Z collection 9
      2019-04-17T12:41:20.999Z drop collection 0
      2019-04-17T12:41:21.003Z drop collection 1
      2019-04-17T12:41:21.009Z drop collection 2
      2019-04-17T12:41:21.018Z drop collection 3
      2019-04-17T12:41:21.027Z drop collection 4
      2019-04-17T12:41:21.036Z drop collection 5
      2019-04-17T12:41:21.042Z drop collection 6
      2019-04-17T12:41:21.052Z drop collection 7
      2019-04-17T12:41:21.061Z drop collection 8
      2019-04-17T12:41:21.071Z drop collection 9
      2019-04-17T12:41:21.080Z drop 8800
      2019-04-17T12:41:21.082Z finish 8800 | 685

       

        1. 3.6.11-30000_cycles-disk_storage-WiredTiger.png
          3.6.11-30000_cycles-disk_storage-WiredTiger.png
          103 kB
        2. dhandles.png
          dhandles.png
          507 kB
        3. heap.png
          heap.png
          231 kB
        4. Screen Shot 2019-04-18 at 4.39.37 PM.png
          Screen Shot 2019-04-18 at 4.39.37 PM.png
          60 kB
        5. test.js
          3 kB
        6. x-4110.tgz
          7.80 MB
        7. x-in-memory.tgz
          120 kB

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            assaf-oren assaf-oren
            Votes:
            1 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: