I'm a bit surprised by what I observe in my mongo server, so I would like to know if anybody understand how this is possible.
I have one collection of around 15K documents. For each of them, I store in GridFS 3 files, with an average size of 1MB per file. So the expected storageSize should be something near 60GB (if considering the size of the document itself to be 1MB too). I can't test all my data by hand, but I really want to be sure everything is here and that there is no missing data for some of the documents.
Here is what I get :
> db.stats();
{
"db" : "myBase",
"collections" : 6,
"objects" : 348822,
"avgObjSize" : 195475.27135329766,
"dataSize" : 68186075104,
"storageSize" : 69329817136,
"numExtents" : 73,
"indexes" : 14,
"indexSize" : 42171808,
"fileSize" : 67108864,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}
so storageFile ~ 65GB, this is acceptable.
But when I look at the file system
$ ps -edf | grep mongo
user 20728 1 0 2014 ? 05:31:03 /opt/tools/bin/mongod --dbpath=/local/mongo-data
$ cd /local/mongo-data
$ du -h
4.0K ./_tmp
721M ./journal
8.8G .
$ du -h *
721M journal
65M myBase.0
2.0G myBase.37
2.0G myBase.5
2.0G myBase.7
2.0G myBase.8
17M myBase.ns
4.0K _tmp
How come the data on disk takes LESS space that what it says in mongo ? Why doesn't appear anywhere a stat with a value of 8GB ?
I add stats from files and chunks if it can help understand what is happening
> db.fs.files.stats();
{
"ns" : "myBase.fs.files",
"count" : 48911,
"size" : 14316208,
"avgObjSize" : 292.69914743104823,
"storageSize" : 18898944,
"numExtents" : 7,
"nindexes" : 2,
"lastExtentSize" : 7647232,
"paddingFactor" : 1,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 7873488,
"indexSizes" : {
"_id_" : 2076704,
"filename_1_uploadDate_1" : 5796784
},
"ok" : 1
}
> db.fs.chunks.stats();
{
"ns" : "myBase.fs.chunks",
"count" : 283537,
"size" : 67787872056,
"avgObjSize" : 239079.45719958947,
"storageSize" : 68819078704,
"numExtents" : 48,
"nindexes" : 2,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 27324192,
"indexSizes" : {
"_id_" : 11781616,
"files_id_1_n_1" : 15542576
},
"ok" : 1
}
Aucun commentaire:
Enregistrer un commentaire