[SERVER-22790] "avg obj size on shard" is avg for cluster not shard Created: 22/Feb/16  Updated: 12/Dec/23

Status: Backlog
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Steven Hand Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Cluster Scalability
Operating System: ALL
Participants:

 Description   

The "avg obj size on shard" is calculated to be the average of the average document (object) size. "avg obj size on shard" should be the average document size on that shard.



 Comments   
Comment by Steven Hand [ 22/Feb/16 ]

Here is an example, with the actual machine names redacted:

mongos> db.test_collection.getShardDistribution()
Shard <shard1>
data : 536KiB docs : 16657 chunks : 1042
estimated data per chunk : 527B
estimated docs per chunk : 15
Shard <shard2>
data : 16.25MiB docs : 516657 chunks : 1042
estimated data per chunk : 15KiB
estimated docs per chunk : 495
Shard <shard3>
data : 537KiB docs : 16686 chunks : 1042
estimated data per chunk : 528B
estimated docs per chunk : 16
Totals
data : 17.3MiB docs : 550000 chunks : 3126
Shard <shard1> contains 3.02% data, 3.02% docs in cluster, avg obj size on shard : 33B
Shard <shard2> contains 93.93% data, 93.93% docs in cluster, avg obj size on shard : 33B
Shard <shard3> contains 3.03% data, 3.03% docs in cluster, avg obj size on shard : 33B

The "avg obj size on shard" for <shard1> is 528 / 16 = 33
The "avg obj size on shard" for <shard2> is 15000 / 495 = 30.3030303030303
The "avg obj size on shard" for <shard3> is 527 / 15 = 35.13333333333333

We should should print those values, not the average of the three, 33 + 30.3 + 35.13 / 3 = 32.81 or 33

Generated at Thu Feb 08 04:01:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.