Re: [mongodb-user] local db size over 2GB

242 views
Skip to first unread message

Sam Millman

unread,
Jan 14, 2013, 4:41:20 AM1/14/13
to mongod...@googlegroups.com
Can you run a stats on your main db and give us some info about how many objects you are storing, have you also read: http://docs.mongodb.org/manual/faq/storage/#faq-disk-size ?


On 14 January 2013 09:28, Colonel Tigh <muz...@gmail.com> wrote:
Hi,

Anybody knows why local db grows so much over 3 month?
apn:PRIMARY> show dbs
admin (empty)
iphones 0.203125GB
local 2.0146484375GB
todos 0.203125GB

Do I need to do anything about it?


--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Stephen Steneker

unread,
Mar 1, 2013, 10:05:43 AM3/1/13
to mongod...@googlegroups.com
Anybody knows why local db grows so much over 3 month?
apn:PRIMARY> show dbs
admin (empty)
iphones 0.203125GB
local 2.0146484375GB
todos 0.203125GB

Do I need to do anything about it?

Hi,

The local database is created when you enable replication.  The largest collection in that database is a capped collection "oplog.rs" which contains a rolling record of operations that modify data:
 
http://docs.mongodb.org/manual/core/replication/#oplog

MongoDB applies database operations on the primary and then records the operations on the primary’s oplog. The secondary members then replicate this log and apply the operations to themselves in an asynchronous process.

Since the oplog is a capped collection, disk space will be preallocated on creation and does not shrink or grow.  The default size of the oplog on 64-bit linux is 5% of free disk space.  The oplog default is smaller on systems that are typically used for development (OS X, 32-bit).  The documentation link above includes the full details.

If you want to see some information on the oplog size in the shell, run db.printReplicationInfo(). 

Cheers,
Stephen
Reply all
Reply to author
Forward
0 new messages