The padding factor is around 1.0 on 3 shards and 1.3 on one shard (see
below).
Using the "right" query, I get the following exception, where max BSON
size is greater than 2.6 times of the DBObject size:
Exception in thread "main" com.mongodb.MongoInternalException:
DBObject of size 6442515 is over Max BSON size 16777216
at com.mongodb.OutMessage.putObject(OutMessage.java:147)
at com.mongodb.OutMessage._appendQuery(OutMessage.java:85)
at com.mongodb.OutMessage.query(OutMessage.java:44)
at com.mongodb.OutMessage.query(OutMessage.java:38)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:303)
at com.mongodb.DBCursor._check(DBCursor.java:369)
at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
at com.mongodb.DBCursor.hasNext(DBCursor.java:523)
mongos> db.offer.stats()
{
"sharded" : true,
"flags" : 1,
"ns" : "offerStore.offer",
"count" : 94043357,
"numExtents" : 251,
"size" : 182913750120,
"storageSize" : 283038796064,
"totalIndexSize" : 33238383360,
"indexSizes" : {
"_id_" :
3348210992,
"bokey_1" : 7212466576,
"categoryBokey" : 6988288832,
"clickCount" : 2180187632,
"mappedCatalogCategory" : 3768432864,
"missingSince" : 2873095456,
"onlineProductIds" : 2961935872,
"shopId" : 3905765136
},
"avgObjSize" : 1944.9938406601118,
"nindexes" : 8,
"nchunks" : 9494,
"shards" : {
"offerStoreDE2" : {
"ns" : "offerStore.offer",
"count" : 32521119,
"size" : 58552151128,
"avgObjSize" : 1800.434699925301,
"storageSize" : 76310707744,
"numExtents" : 66,
"nindexes" : 8,
"lastExtentSize" :
2146426864,
"paddingFactor" : 1.3199999992045253,
"flags" : 1,
"totalIndexSize" : 11378604608,
"indexSizes" : {
"_id_" : 1178930144,
"shopId" : 1295757008,
"mappedCatalogCategory" : 1227626400,
"missingSince" : 1076313168,
"clickCount" : 718089904,
"categoryBokey" :
2366886592,
"bokey_1" :
2562423808,
"onlineProductIds" : 952577584
},
"ok" : 1
},
"offerStoreDE3" : {
"ns" : "offerStore.offer",
"count" : 19263196,
"size" : 43881514208,
"avgObjSize" : 2277.9975974910913,
"storageSize" : 99921403248,
"numExtents" : 77,
"nindexes" : 8,
"lastExtentSize" :
2146426864,
"paddingFactor" : 1.0099999975193636,
"flags" : 1,
"totalIndexSize" : 7413522592,
"indexSizes" : {
"_id_" : 782426848,
"shopId" : 898910320,
"mappedCatalogCategory" : 846354992,
"missingSince" : 607182464,
"clickCount" : 518088592,
"categoryBokey" : 1543097360,
"bokey_1" : 1553873328,
"onlineProductIds" : 663588688
},
"ok" : 1
},
"offerStoreDE4" : {
"ns" : "offerStore.offer",
"count" : 24164368,
"size" : 48108572960,
"avgObjSize" : 1990.888938622355,
"storageSize" : 67725000288,
"numExtents" : 62,
"nindexes" : 8,
"lastExtentSize" :
2146426864,
"paddingFactor" : 1.009999998815975,
"flags" : 1,
"totalIndexSize" :
8557336816,
"indexSizes" : {
"_id_" : 799988896,
"shopId" : 1031361520,
"mappedCatalogCategory" : 1005320960,
"missingSince" : 710052896,
"clickCount" : 566752144,
"categoryBokey" : 1806503552,
"bokey_1" : 1812921712,
"onlineProductIds" : 824435136
},
"ok" : 1
},
"offerstore" : {
"ns" : "offerStore.offer",
"count" : 18094674,
"size" : 32371511824,
"avgObjSize" : 1789.007739183364,
"storageSize" : 39081684784,
"numExtents" : 46,
"nindexes" : 8,
"lastExtentSize" :
2146426864,
"paddingFactor" : 1.049999999691875,
"flags" : 1,
"totalIndexSize" :
5888919344,
"indexSizes" : {
"_id_" : 586865104,
"shopId" : 679736288,
"mappedCatalogCategory" : 689130512,
"missingSince" : 479546928,
"clickCount" : 377256992,
"categoryBokey" : 1271801328,
"bokey_1" : 1283247728,
"onlineProductIds" : 521334464
},
"ok" : 1
}
},
"ok" : 1
}
On Apr 19, 2:07 pm, Max Schireson <
mschire...@gmail.com> wrote:
> I am guessing here which I hate to do but I wonder if that is showing the
> raw document size and with the padding factor for inserts it exceeds the
> maximum?
>
> You can see what the padding factor is by running db.coll.stats - you may
> want to check that?
>
> -- Max