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

Drop in performance for the insert command after restarting the MongoDB database

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None

      Good afternoon,

      Our team has experienced a substantial drop in performance for the bulk insert command (when inserting 10,000 documents) after restarting the MongoDB database (3.2.20). Based on a brief analysis, there seem to be two issues: (1) The particular collection uses random scattered keys (2) The index tree is only partially loaded in the CPU memory.

      The first issue can be easily fixed by prepending timestamp to the scattered keys. For resolving the second issue, we are looking for feedback from MongoDB experts. Specifically, there are three questions:

      1. Is it “a bug or feature” of the MongoDB database to keep only a part of the index tree in CPU memory? We are using a multi-core server with around 200 GB memory. According to the collection statistics, however, the ‘datum_id_1’ cache contains only 1,912,845,502.0 bytes while the total index size is 9,059,713,024.0 as demonstrated by the following script:

      https://github.com/malitsky/nsls2/blob/master/mongohxn/tests/insert.6.10.18.ipynb

      1. Is there any mechanism to push and keep an index tree in the CPU memory?
      2. Are the data and index caches managed by one or two different LRU procedures?

      Thank you in advance,

      Nikolay

      This question has been submitted to http://groups.google.com/group/mongodb-user

      and http://stackoverflow.com/questions/tagged/mongodb.

            Assignee:
            dmitry.agranat@mongodb.com Dmitry Agranat
            Reporter:
            nmalitsky Nikolay Malitsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: