2

I am using mongodb 2.6. In that I have observed that write/insert latency increases when no. of shards increase.

I have used ycsb to test above behavior and sharding is hash based on primary key _id.

Results are like,

no. of shards   insert latency (in microseconds)
3               2535
4               2792
5               2842

Though time difference is not too much but it is constant. (I have tried this multiple times and results are consistent) I know Mongo creates index on shard key and for every insert index modification happens. I am not sure why insert latency is increasing as index modification penalty will be independent of no. of shards.

Note: While insert I have kept writeconcern:none, nojournal option true and 2 replicas of each shard are on same node.

Nachiket Kate
  • 8,473
  • 2
  • 27
  • 45

0 Answers0