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

Insert loop from the shell is slow in MongoDB 2.6 compare to MongoDB 2.4

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • ALL

      I was testing the performance of MongoDB 2.6 and insert is taking more time.

      people = ["Marc", "Bill", "George", "Eliot", "Matt", "Trey", "Tracy", "Greg", "Steve", "Kristina", "Katie", "Jeff"];
      for(var i=0; i<1000000; i++){
         name = people[Math.floor(Math.random()*people.length)];
         user_id = i;
         boolean = [true, false][Math.floor(Math.random()*2)];
         added_at = new Date();
         number = Math.floor(Math.random()*10001);
         db.test_collection.save( {"name":name, "user_id":user_id, "boolean": boolean, "added_at":added_at, "number":number },{writeConcern: {w:0}});
      }
      

      This insert 1M records. MongoDB 2.4 took 7 minutes, MongoDB 2.6 took 14 minutes. The test was done on two servers also. It is AWS server with 4 CPU, 15GB Memory and same I/O speed( Server : m3.xlarge) . Also test was done when no one is accessing the server other than the test.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sarbamangal Sarbamangal Choudhury
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: