[DOCS-77] Should the storageSize sum of all collections of one database match the size on disk? Created: 08/Nov/11 Updated: 29/Nov/12 Resolved: 08/Nov/11 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Nolte | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ext4, MongoDB 2.0.0 |
||
| Participants: | |
| Days since reply: | 12 years, 15 weeks, 1 day ago |
| Description |
|
size = 0; db.getCollectionNames().forEach(function(c) { size += db[c].stats().storageSize }} => 80401852864 or db.stats() vs du -chs database_name.* => 172G Shouldn't these value roughly match? |
| Comments |
| Comment by Sam Kleinman (Inactive) [ 08/Nov/11 ] |
|
Hi, I'm glad to hear that this fixed your problem. Don't hesitate to send questions to the Google group in the future if you have issues. Regards, |
| Comment by Nolte [ 08/Nov/11 ] |
|
Hi, thanks for your help - db.stats().fileSize matches. Thanks |
| Comment by Sam Kleinman (Inactive) [ 08/Nov/11 ] |
|
Hello, The value of `du` should (and I believe does) more closely reflect the "fileSize" field (including "nsSizeMB") This value is likely larger than "storageSize" because of Padding Factor and data file preallocation. See the following documents for more information. The following documents may help explain this further: http://www.mongodb.org/display/DOCS/Padding+Factor http://www.mongodb.org/display/DOCS/Excessive+Disk+Space You may find a better/more timely response for questions like these in the "mongo-uesr" group. You can find that here: http://groups.google.com/group/mongodb-user Cheers, |