dimanche 1 février 2015

MongoDB GridFS delete operation too slow while mongod process takes up 100% CPU


I'm using Python (CPython 2.7.3 on Debian 7.8 amd64) with pymongo driver (version 2.7.2) to connect to a MongoDB (db version v2.4.12) database which has solely been used to store files in a GridFS storage collection. While mongodb can find the _id of a file object with a given filename instantaneously, requesting to delete that file given its _id takes an unusual 10s of seconds to complete during which mongod takes up 100% CPU time.


I'm not a mongodb expert and have not done any performance optimizations on it, but still I think there is something wrong here. What am I missing and how can I pinpoint and solve this problem?


I should add that there are millions of files in this collection with nearly 700GB size, and the free space left on disk is running very low.


Edit:



> db.stats()
{
"db" : "imagedb",
"collections" : 6,
"objects" : 80435832,
"avgObjSize" : 6521.6805692766375,
"dataSize" : 524576802628,
"storageSize" : 563036266512,
"numExtents" : 308,
"indexes" : 7,
"indexSize" : 6604172176,
"fileSize" : 588057149440,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}




Aucun commentaire:

Enregistrer un commentaire