replicaset有兩個secondary,Eventual mode
,但在使用labix/mgo.v2
連接mongo時,發現所有的read都只集中在一個secondary上了,僅有很少的量會訪問另外一個secondary 。
// Read preference modes are specific to mgo: Eventual Mode = 0 // Same as Nearest, but may change servers between reads. Monotonic Mode = 1 // Same as SecondaryPreferred before first write. Same as Primary after first write. Strong Mode = 2 // Same as Primary.
1、檢查一下connect URL的設定;
2、如果讀取的Load Balance和你設定的參數的預期不一樣,可以考慮配合設定Tag,進一步配置從什麼member讀。
供參考。
Love MongoDB! Have Fun!