mongodb creates 80+ files 2GB each while database is empty

后端 未结 2 746
灰色年华
灰色年华 2021-01-15 00:00

Background:

I set the replicaSet and initiated 3 instances (1 arbiterOnly) of mongod on localhost using different ports.

I haven noticed tha

相关标签:
2条回答
  • 2021-01-15 00:40

    It sounds like it's preallocating space for the oplog. The oplog is allocated regardless of what you have inserted into the database http://www.mongodb.org/display/DOCS/Excessive+Disk+Space:

    The replication oplog is preallocated as a capped collection in the local database.

    The default allocation is approximately 5% of disk space (64 bit installations).

    If you would like a smaller oplog size use the --oplogSize command line parameter.

    0 讨论(0)
  • 2021-01-15 00:48

    There are various command line parameters I have found to reduce the size of the empty database.

    Already mentioned:

    --oplogSize <value>
    

    Also:

    --smallfiles
    --nssize <value>
    

    The combination of all 3 parameters makes for an 18mb empty database (tested against MongoDB 64bit, Windows 7).

    http://docs.mongodb.org/manual/reference/program/mongod/

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