Calculating RAM requirement of mongodb

2,729 views
Skip to first unread message

jitendra verma

unread,
Mar 29, 2013, 3:54:37 AM3/29/13
to mongod...@googlegroups.com
Hi,

1. We have following configuration of mongodb:(journal enabled)
On machines-1 have following servers 
       mongod - 5
       config server - 2
       mongos -  1 
 On machines-2 have following servers
       mongod - 5
       config server - 1
2. Mongod's on both the machines are writing data to a RAID-5 disk array, which has total 100TB storage, where  each mongod is allotted 9.1Tstorage. 
3. We have 10 GB ram each on both machine.

Our use case is following 
1. Day wise databases. Database of 365 days(for one year), so maximum database is 365 at a time.     
2.  Insert rate - 1000 new objects per minute into current date db, where each object's avg size is 250 KB.  
3. Index size per day is around 40-70 MB combined. (combined means of all Mongods)

RAM requirement: 
1. Considering 70MB index size per day for 365 days will be 22 GB. As mongodb suggests all indexes should be in RAM so minimum RAM requirement should be 22GB.
    so we need 11 GB RAM each for both machine. Is this calculation correct? Should we consider only indexes for RAM requirement or what other considerations should we have? How much RAM should we have on both the nodes? 

Currently we are getting huge page fault on both machine. 
Please help me to calculate how much RAM we need for this System and how to reduce huge page fault.

T&R,

Kelly Stirman

unread,
Mar 29, 2013, 7:56:47 AM3/29/13
to mongod...@googlegroups.com
I think the question you want to ask is "how large is my working set". Your working set should fit in RAM for best performance.

There's a new feature in 2.4 to help you estimate the size of your working set: http://docs.mongodb.org/manual/reference/server-status/#server-status-workingset

You need to think about the size of the indexes AND the data that will be accessed most frequently. It is not the case that MongoDB stores only indexes in RAM. 

What is the motivation for 10 mongod processes across 2 servers?

A few comments on your architecture:

you will benefit from more RAM on each server or more servers.
you can run multiple mongod per server, but it is likely they will compete for disk i/o
if you run multiple mongod per server, be sure to size the oplog appropriately
RAID-5 will provide the worst throughput. you might consider RAID-10 instead
be sure to set your readahead size appropriately
unclear if you are using replica sets to provide redundancy for improved availability, but it seems likely that if one of your servers fails your system will become unavailable
you might consider locating your mongos with your application server instead of one of these two servers

More on RAID and readahead and other important topics here: http://docs.mongodb.org/manual/administration/production-notes/

Kelly

jitendra verma

unread,
Apr 1, 2013, 11:36:50 AM4/1/13
to mongod...@googlegroups.com
Hi Kelly Stirman,

We are using mongodb version: 2.0.3-rc0 in production, for estimating  working set , we have to update mongodb binary version to 2.4.
Changing mongodb binary in production required more effort in term of testing. 
is there any other way to estimate the size of mongodb working set in mongodb version 2.0.3-rc0 ?

T&R,
JRV 

Kelly Stirman

unread,
Apr 1, 2013, 6:29:44 PM4/1/13
to mongod...@googlegroups.com

jitendra verma

unread,
Apr 3, 2013, 11:23:47 AM4/3/13
to mongod...@googlegroups.com
Hi Kelly Stirman

Sorry i forgot to anserwere your comments
Please find my Answered. 
1.What is the motivation for 10 mongod processes across 2 servers?
ANS: We have system limitation.
2.be sure to set your readahead size appropriately
ANS: Output of 'hdparm -a /dev/mapper/mpath3p1,'
      readahead    = 256 (on)
     Is readahead = 256 (on)appropriate ? 
3. unclear if you are using replica sets to provide redundancy for improved availability, but it seems likely that if one of your servers fails your system will become unavailable
ANS: Not using replication.

4.if you run multiple mongod per server, be sure to size the oplog appropriately
ANS: How can i am sure to size the oplog appropriately?     

T&R,
JRV

jitendra verma

unread,
Apr 8, 2013, 2:19:03 AM4/8/13
to mongod...@googlegroups.com
Hi,
Please any update

T&R,
JRV
Reply all
Reply to author
Forward
0 new messages