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

100% CPU usage in update one field in one document

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.2.3
    • Component/s: WiredTiger, Write Ops
    • Environment:
      Azure VM D2 size
    • ALL
    • Hide

      Fill collection with more than 400.000 documents with many text data (5KB) in some properties. Try to update one field at some object.

      Show
      Fill collection with more than 400.000 documents with many text data (5KB) in some properties. Try to update one field at some object.

      I have a simple social crawler written in C# for testing MongoDB performance and decide - use it in another projects.
      It collected 750.000 documents in collection Post.
      Document post have "IsApproved" property that I want to update.

      Posts collection have _id index and

      { "SiteId" : 1, "IsApproved" : -1, "Date" : -1 }

      I make project to find one with

      {Id, IsApproved}

      and UpdateOne with !Approved (see screenshot).

      Inserting documents fine and my Azure VM (D2 (2 cores Xeon with SSD) CPU costs about 2-8 percent.
      But if I press approve button in my crawler - it "think" 3-5 seconds and costs 40% CPU.
      If i press Approve button multiple times without pause - it kill my server and CPU load at 99% for each update time (see screenshot).
      Don't say than i need be toggle boolean property with XOR command - i approximate it to other updates and i worry.

      How I will use database, that only one update costs so many CPU times ?
      It's not normal behaviour. Maybe that index rebuild ?

        1. 1.png
          50 kB
          zoxexivo
        2. 1.png
          14 kB
          zoxexivo
        3. 2.png
          46 kB
          zoxexivo
        4. 3.png
          52 kB
          zoxexivo
        5. 5.png
          27 kB
          zoxexivo
        6. OneSample.png
          40 kB
          zoxexivo
        7. Screenshot.png
          142 kB
          zoxexivo

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            zoxexivo@gmail.com Ivan Artemov
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: