[Solved] Chapter 3 : Throughput Drops, Part 4 - Cannot reproduce the demonstration

Hi,

has anyone tried to run the python file “write_to_the_same_document.py”, using the option “–docPerProcess” ?
This option is supposed to dramatically improve things, but on my vagrant vm, there’s no effect : I still got messages like this in my log :
2019-03-26T10:20:50.715+0000 I WRITE [conn165] update m312.collisions query: { _id: ObjectId(‘5c99fcf742622a11d08fad52’) } planSummary: IDHACK update: { $inc: { total_updates: 1, process_6.updates: 1 } } keysExamined:1 docsExamined:1 nMatched:1 nModified:1 numYields:1 locks:{ Global: { acquireCount: { r: 3, w: 3 } }, Database: { acquireCount: { w: 3 } }, Collection: { acquireCount: { w: 2 } }, Metadata: { acquireCount: { w: 1 } }, oplog: { acquireCount: { w: 1 } } } 170ms
2019-03-26T10:20:50.715+0000 I COMMAND [conn165] command m312.$cmd command: update { update: “collisions”, ordered: true, updates: [ { q: { _id: ObjectId(‘5c99fcf742622a11d08fad52’) }, u: { $inc: { total_updates: 1, process_6.updates: 1 } }, multi: false, upsert: false } ] } numYields:0 reslen:119 locks:{ Global: { acquireCount: { r: 3, w: 3 } }, Database: { acquireCount: { w: 3 } }, Collection: { acquireCount: { w: 2 } }, Metadata: { acquireCount: { w: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 170ms

In the end, update process still take a lot of time…
Patrick

@Patrick_39140

It works as advertised in my VM. In your case, I see that the collisions have gone away, which was the main point of the lecture and what the script is intended to fix, but for some reason your queries are still running a long time. (170ms). I can’t tell from here why that might be.

You might want to apply some of the other tools to find out why that is. Good luck.

Ok, thanks, I marked this post as solved.