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

MongoDB load increases when updating 57k large records in one query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      MongoDB Server 3.2.8, MongoDB Java Driver 3.0.2, Linux operating system

      Original Summary

      MongoDB Crashed while updating 57k records in one query

      Original Description

      Hi,

      We have been struggling with the mongoDB server crash in production which is happening due to one update query which is updating 57000 records in one shot. Application is sending this update query 300 times sequentially but mongoDB server is unusually getting 700-800% of CPU Usage which is causing the mongoDB to crash.

      Query which creating the crash to happen:

      2017-04-22T18:42:27.896+0000 I WRITE    [conn28248] update hc.Schedule query: { service.bouquetDetails.handle: "dvbBouquet:1.6406E7" } update: { $pull: { service.bouquetDetails: { handle: "dvbBouquet:1.6406E7" } } } keysExamined:57785 docsExamined:57785 nMatched:57785 nModified:57785 keyUpdates:0 writeConflicts:0 numYields:2318 locks:{ Global: { acquireCount: { r: 60104, w: 60104 } }, Database: { acquireCount: { w: 60104 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 118 } }, Collection: { acquireCount: { w: 2319 } }, Metadata: { acquireCount: { w: 57785 } }, oplog: { acquireCount: { w: 57785 } } } 127328ms
       
      2017-04-22T18:53:37.395+0000 I WRITE    [conn24466] update hc.Schedule query: { service.bouquetDetails.handle: "dvbBouquet:1.6409E7" } update: { $pull: { service.bouquetDetails: { handle: "dvbBouquet:1.6409E7" } } } keysExamined:57072 docsExamined:57072 nMatched:57072 nModified:57072 keyUpdates:0 writeConflicts:0 numYields:2249 locks:{ Global: { acquireCount: { r: 59322, w: 59322 } }, Database: { acquireCount: { w: 59322 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 100 } }, Collection: { acquireCount: { w: 2250 } }, Metadata: { acquireCount: { w: 57072 } }, oplog: { acquireCount: { w: 57072 } } } 118500ms
      

      Cluster Setup:

      • We have no sharding.
      • One replica set with three Mongod servers (version: 3.2.8) and two Mongos Server
      • All are running on Linux environment on OpenStack cloud.
      • Application is in java 8 and using mongodb driver 3.0.2

      Questing: Is MongoDB can't handle 57000 records update in one query or there is a bug in MongoDB 3.2.8 version with about specified query.

      Thanks,
      Sulabh

            Assignee:
            Unassigned Unassigned
            Reporter:
            sulabh84 sulabh
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: