From what I see you have an imbalance in your shards,
there are shards with 5,6,7,8 documents, there are others with ~1M, others with ~2M, ~3.7M, and others with >4M documents, I think that you shouldn’t have used a custom clustering scheme based on id, but leave the clause out and rely on the internal _id to get a nice balance across the shards.
Then, from your schema I see that you have configured 10 shards with 2 replicas, so that’s 30 shards in total, but from the query on sys.shards I see over 1000 shards for the table, how come? did you change the sharding scheme with ALTER TABLE
after the initial creation?
Regarding the id
column, I see you’re doing range comparisons on it, and it seems that it holds numeric values, but you have defined it as text
(or string
), this also won’t help, in terms of performance, with your queries where you filter out based on the id
using, basically numeric comparisons.
Do you see excessive GC runs on your nodes?