5

When I run below command in mongo shell,

db.stats()

I get below and this is wired. When I check mongoDB installation folder it only used around 2 GB disk space?

see below fsTotalSize over 80 GB

enter image description here

Pradeep Asanka
  • 403
  • 1
  • 5
  • 11

2 Answers2

9

From dbStats documentation:

  • fsTotalSize and fsUsedSize are about the filesystem that the database is stored on. They'd be used to get an idea about how much the database could grow to.
  • dataSize is the size of the all the documents themselves.
  • storageSize is the size of the data stored on the filesystem (it can be smaller than the dataSize if using compression).

So the database takes up 6.7MB on the filesystem.

kmdreko
  • 42,554
  • 6
  • 57
  • 106
  • 1
    the `indexSize` is also relevant-- it is not included in `dataSize` and it can be pretty large if you have many indexes – Kip Jan 07 '20 at 18:53
0

dbStats

dbStats.fsTotalSize - Total size of all disk capacity on the filesystem where MongoDB stores data.

It looks like 80 GB is the total of all disk capacity on the filesystem

Mani
  • 1,471
  • 1
  • 13
  • 19