How can I get mongo db actual size? - mongodb

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

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.

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

Related

command to check used Journal space MongoDB

whats the command in mongo to check current Journal space used or whats the limit set
using Mongo version 3.2.8 and storage engine wiredTiger
What is the Journal space used by Mongo?
MongoDB uses a journal file size limit of 100 MB, WiredTiger creates a new journal file approximately every 100 MB of data. When WiredTiger creates a new journal file, WiredTiger syncs the previous journal file.
Source Journaling
How can I reduce the Journal file size?
Yes - there is a way to minimize the default size of the journal
files, subject to a couple of caveats. From the MongoDB configuration
documentation:
To reduce the impact of the journaling on disk usage, you can leave journal enabled, and set smallfiles to true to reduce the size of the
data and journal files.
Here is the smallfiles config information:
Set to true to modify MongoDB to use a smaller default data file size. Specifically, smallfiles reduces the initial size for data files
and limits them to 512 megabytes. The smallfiles setting also reduces
the size of each journal files from 1 gigabyte to 128 megabytes.
Use the smallfiles setting if you have a large number of databases that each hold a small quantity of data. The smallfiles setting can
lead mongod to create many files, which may affect performance for
larger databases.
Source Run a MongoDB configuration server without 3GB of journal files, answer by platforms

How heroku postgres works with 0 bytes of RAM

On heroku postgres plan page https://elements.heroku.com/addons/heroku-postgresql, it is mentioned that for hobby plans there is 0 bytes of RAM. Does it mean that Postgres is working without RAM?
The 0 bytes RAM refers to the amount of in-memory cache allocated to your datastore. Heroku says...
The lack of an in-memory cache limits performance, because the data can’t be accessed on low-latency storage.

Backing up mongo database of about 120 GB size

We have a mongo database of about 120 GB size. I have run mongodump using nohup and redirecting the logs to /dev/null about 3 days back, but the dump file is ~40GB in size now, and the dump is still running. Is this expected?
If yes, what is the approximate compression ratio for a mongo database? i.e. for a 120 GB database, how much is the backup file size going to be?
This would help me in estimating the time remaining for the dump to finish. I have no clue why it is taking up so much time, also, wanted to know if there is a faster/better way of backing up the mongo database (remote copy is not something i'm considering)?

What maps MongoDb into memory

Does MongoDb mmap everything (i.e. all data files + all indexes) into memory on start?
If database has 100GB and machine has only 4GB RAM, MongoDb mmaps whole database into memory, is it right?
MongoDB uses memory-mapped files for all data. See the following documentation for how this works:
http://docs.mongodb.org/manual/faq/storage/#what-are-memory-mapped-files
http://www.mongodb.org/display/DOCS/Checking+Server+Memory+Usage
http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo#StartingandStoppingMongo-MemoryUsage
http://www.mongodb.org/display/DOCS/Caching

Mongodb32-bit limitation is for single database?

I am using mongodb-v2.0. I have gone through the 32-bit mongodb limitation of "2GB". The thing which baffling me is 2GB limitation. I will explain our scenario :-
When the database reaches 2GB. It is possible to use different database name in a single instance.If so then each database will have 2GB? Can we use different instance of mongodb listening on different port. If its possible,then can we continue in creating new database until it reaches 2GB of size?. In this way can we use multiple database of size 2GB on 32-bit mongodb on 32-bit machines?
Thanks,
sampath
The 2GB are the storage limit for the mongodb server. See in the FAQ http://www.mongodb.org/display/DOCS/FAQ#FAQ-Whatarethe32bitlimitations%3F
But maybe this is your solution: Database over 2GB in MongoDB