Note that there are some explanatory texts on larger screens.

plurals
  1. POmongodb update operation on shards very slow
    primarykey
    data
    text
    <p>I have a little cluster which consists of 3 shards, and every shard is a replica set of 2 real nodes and 1 ARBITER. sharding is enabled on a collection, let's say <code>coll_words</code>, key is <code>title</code>.</p> <p>other info:</p> <ul> <li><p><code>rs.slaveOk()</code> is on and <code>balancer</code> is off. </p></li> <li><p>the primary shard of this collection contains around 13M documents, the other 2 secondary ones each contains around 5M.</p></li> <li><p>average ping between shards is below 1 millis. Pings from mongos to shard is about <code>3 Millis</code> with <code>'connPoolStats'</code> command.</p></li> </ul> <p>The typical <code>find()</code> response through a mongos like this (<code>update()</code> is slow too):</p> <pre><code>mongos&gt; db.coll_words.find({title:'りのフランス'}).explain() { "clusteredType" : "ParallelSort", "shards" : { "rsName/IP1:27017,IP2:27017" : [ { "cursor" : "BtreeCursor title_1", "isMultiKey" : false, "n" : 1, "nscannedObjects" : 1, "nscanned" : 1, "nscannedObjectsAllPlans" : 1, "nscannedAllPlans" : 1, "scanAndOrder" : false, "indexOnly" : false, "nYields" : 0, "nChunkSkips" : 0, "millis" : 0, "indexBounds" : { "title" : [ [ "りのフランス", "りのフランス" ] ] }, "server" : "SERVER:27017" } ] }, "cursor" : "BtreeCursor title_1", "n" : 1, "nChunkSkips" : 0, "nYields" : 0, "nscanned" : 1, "nscannedAllPlans" : 1, "nscannedObjects" : 1, "nscannedObjectsAllPlans" : 1, "millisShardTotal" : 0, "millisShardAvg" : 0, "numQueries" : 1, "numShards" : 1, "indexBounds" : { "title" : [ [ "りのフランス", "りのフランス" ] ] }, "millis" : 51 } </code></pre> <p>></p> <p>It's really confusing to me, why this <em>finally</em> costs <strong><code>"millis" : 51</code></strong>? </p> <p>Am I missing something? Any pointers would be great.</p> <p><strong>Update:</strong></p> <p>Pings from mongos to shard is about <code>3 Millis</code> with <code>'connPoolStats'</code> command.</p> <pre><code>"replicaSets" : { "rs0" : { "hosts" : [ { "addr" : "IP1:27017", "ok" : true, "ismaster" : false, "hidden" : false, "secondary" : true, "pingTimeMillis" : 3 }, { "addr" : "IP2:27017", "ok" : true, "ismaster" : true, "hidden" : false, "secondary" : false, "pingTimeMillis" : 2 } ], "master" : 1, "nextSlave" : 0 }, </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload