-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 7.0 Required
-
Component/s: None
-
None
-
Product Performance
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Hi,
I did a load test on v4.4.29 and v7.0.12. I understand there is some performance deviation when upgrading. But here the test shows a big deviation of about 4min run vs 67min run respectively. This is 120% performance degradation and a huge difference comparatively. You can see 4.3K ops/sec in 4.4 vs 250ops/sec in 7.0Is it expected?
I used a single member replicaset for both tests:
4.4:
replset:PRIMARY> use vinodh switched to db vinodh replset:PRIMARY> var randomName = function() { ... // Base 36 uses letters and digits to represent a number: ... return (Math.random()+1).toString(36).substring(2); ... }; replset:PRIMARY> var day = 1000 * 60 * 60 * 24; replset:PRIMARY> var randomDate = function () { ... return new Date(Date.now() - (Math.floor(Math.random() * day))); ... }; replset:PRIMARY> new Date() ISODate("2024-06-29T13:41:15.985Z") replset:PRIMARY> for (var i = 1; i <= 1000000; ++i) { db.version44Test.insertOne({ name: randomName(), creationDate: randomDate(), uid: i }); } new Date() new Date() { "acknowledged" : true, "insertedId" : ObjectId("668010124e441d0a9616a43f") } replset:PRIMARY> new Date() ISODate("2024-06-29T13:45:54.886Z") replset:PRIMARY> new Date() ISODate("2024-06-29T13:45:54.886Z")
7.0:
replset [direct: primary] vinodh> var randomName = function() { ... // Base 36 uses letters and digits to represent a number: ... return (Math.random()+1).toString(36).substring(2); ... }; replset [direct: primary] vinodh> var day = 1000 * 60 * 60 * 24;replset [direct: primary] vinodh> var randomDate = function () { ... return new Date(Date.now() - (Math.floor(Math.random() * day))); ... }; replset [direct: primary] vinodh> new Date() ISODate('2024-06-29T13:48:36.550Z') replset [direct: primary] vinodh> for (var i = 1; i <= 1000000; ++i) { ... db.afterUpg7.insertOne({ ... name: randomName(), ... creationDate: randomDate(), ... uid: i ... }); ... } new Date() new Date() { acknowledged: true, insertedId: ObjectId('66802e58a034b0dc4d314517') } replset [direct: primary] vinodh> new Date() ISODate('2024-06-29T15:55:04.460Z') replset [direct: primary] vinodh> new Date() ISODate('2024-06-29T15:55:04.477Z')