0

I am using MongoDB using C#.

I am currently using only a single server.

Since I have to create Table events for MongoDB collections I have created a single replica set(primary). And using oplog.rs table.

I have created only one Database : MyDatabase I also have a capped collection in this Database, and some 5 or 6 tables with very less data.

The Issue here MongoDB size become so huge. There is not much data present , the data wont be more than 500MB but my MongoDb took 20GB data of my Harddisk.

When I checked inside data\db folder

there is 6 copies of my database MyDatabase has been created automatically. Each of which consuming 2GB

MyDatabase.0 MyDatabase.1 MyDatabase.2 MyDatabase.3 MyDatabase.4 MyDatabase.5

and

local.0 local.1 local.2 local.3 local.4 local.5

In the Overview it shows understorage the oplog allocated 8.5GB and the capped collection 4.7 GB

The confusion here is No data more than 500MB is present in the Database but still mongoDB took 20GB.

Am I doing something wrong here with the settings. Please help me in this

Thanks

1 Answers1

0

This is normal for MongoDB. The FAQ has a thorough entry explaining it.

You might consider setting the smallFiles setting on your configuration file.

There is also some good information in the answers to this question: Auto compact the deleted space in mongodb?

Community
  • 1
  • 1
Martin
  • 5,119
  • 3
  • 18
  • 16