[SERVER-6606] How to reclaim or purge the FileSize of a collection Created: 26/Jul/12  Updated: 15/Aug/12  Resolved: 27/Jul/12

Status: Closed
Project: Core Server
Component/s: Performance, Storage
Affects Version/s: 2.0.6
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Jianfeng Xu Assignee: William Zola
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

I have a database with only a collection. But FileSize of the UserDb db is huge, and there are lots of files on linux filesytem and disk' util% is high. How to reclaim or purge it.

PRIMARY> show tables
loginStatus
system.indexes
PRIMARY> db.loginStatus.stats()
{
"ns" : "UserDb.loginStatus",
"count" : 57737693,
"size" : 8290810936,
"avgObjSize" : 143.59442688505064,
"storageSize" : 35528597328,
"numExtents" : 47,
"nindexes" : 4,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 16614400544,
"indexSizes" :

{ "_id_" : 1873489520, "Time_1_SoftwareVer_1_Resource_1" : 3683884848, "UserId_1" : 5463791872, "Time_1_UserId_1" : 5593234304 }

,
"ok" : 1
}
PRIMARY> db.stats()
{
"db" : "UserDb",
"collections" : 3,
"objects" : 58491118,
"avgObjSize" : 143.59493302897715,
"dataSize" : 8399028172,
"storageSize" : 35528613712,
"numExtents" : 49,
"indexes" : 4,
"indexSize" : 16834547520,
"fileSize" : 102962823168,
"nsSizeMB" : 16,
"ok" : 1
}

ls /data/mongodb/data/UserDb/
_tmp UserDb.13 UserDb.19 UserDb.24 UserDb.3 UserDb.35 UserDb.40 UserDb.46 UserDb.51
UserDb.0 UserDb.14 UserDb.2 UserDb.25 UserDb.30 UserDb.36 UserDb.41 UserDb.47 UserDb.6
UserDb.1 UserDb.15 UserDb.20 UserDb.26 UserDb.31 UserDb.37 UserDb.42 UserDb.48 UserDb.7
UserDb.10 UserDb.16 UserDb.21 UserDb.27 UserDb.32 UserDb.38 UserDb.43 UserDb.49 UserDb.8
UserDb.11 UserDb.17 UserDb.22 UserDb.28 UserDb.33 UserDb.39 UserDb.44 UserDb.5 UserDb.9
UserDb.12 UserDb.18 UserDb.23 UserDb.29 UserDb.34 UserDb.4 UserDb.45 UserDb.50 UserDb.ns



 Comments   
Comment by William Zola [ 27/Jul/12 ]

Hi Jianfeng!

I look forward to seeing you in Stack Overflow. We do not use a mailing list because Google Groups provides archiving and the ability to search for old answers, which a mailing list does not provide.

Have a great day!

-William

Comment by Jianfeng Xu [ 27/Jul/12 ]

Thanks for your advices!
In China, the Google Group is blocked and most of the time it cant be accessed. So i will try to use the MongoDB section of Stack Overflow to slove questions.

Why not to use a mail list for MongoDB community?

Comment by William Zola [ 26/Jul/12 ]

Hi Jianfeng!

Thank you for submitting this issue. Please be aware that if you have a question about your MongoDB system, the normal procedure is to submit a question in the MongoDB Google Group or in the MongoDB section of Stack Overflow. Filing a SERVER ticket in our Jira system is intended for people who have found a reproducible bug in MongoDB, or who wish to file an Enhancement Request for MongoDB.

The output you have submitted suggests that there is fragmentation in your MongoDB data files. You will need to use the 'repair' facility to free up that space.

Please consult the documentation in http://www.mongodb.org/display/DOCS/Excessive+Disk+Space#ExcessiveDiskSpace-RecoveringDeletedSpace for instructions on how to reclaim this disk space.

Please let me know if you have further issues. Have a great day!

-William

Generated at Thu Feb 08 03:12:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.