MongoDB - file size is huge and growing

后端 未结 1 1397
野性不改
野性不改 2020-12-23 15:06

I have an application that use mongo for storing short living data. All data older than 45 minutes is removed by script something like:

oldSearches = [list o         


        
相关标签:
1条回答
  • 2020-12-23 15:54

    Virtual memory size and resident size will appear to be very large for the mongod process. This is benign: virtual memory space will be just larger than the size of the datafiles open and mapped; resident size will vary depending on the amount of memory not used by other processes on the machine.

    http://www.mongodb.org/display/DOCS/Caching

    When you remove an object from MongoDB collection, the space it occupied is not automatically garbage collected and new records are only appended to the end of data files, making them grow bigger and bigger. This explains it all:

    http://www.mongodb.org/display/DOCS/Excessive+Disk+Space

    For starters, simply use:

    db.repairDatabase()
    
    0 讨论(0)
提交回复
热议问题