I have something around 200 GB worth data stored in a mongo cluster. The physical memory on one of the instances which runs mongo is 8GB. Nothing else of any consequence runs on this instance. As near as I can understand based on Mongo's docs (like this one: http://www.mongodb.org/display/DOCS/Checking+Server+Memory+Usage) this means that the mongod process should be using about 100% of the available physical memory. But if you look at the following output from the
top command you'll see that the mongod instance is only using 2GB of resident memory and theres a full 2GB of free physical memory available which isn't being used at all.
Can someone explain this behavior to me? Why is there 2GB of free memory?
top - 23:19:43 up 89 days, 20:05, 2 users, load average: 0.41, 0.55, 0.59 Tasks: 101 total, 1 running, 100 sleeping, 0 stopped, 0 zombie Cpu(s): 2.0%us, 1.3%sy, 0.0%ni, 93.9%id, 2.6%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 8163664k total, 6131764k used, 2031900k free, 54976k buffers Swap: 16771848k total, 10604k used, 16761244k free, 5367700k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1401 mongodb 20 0 174g 2.0g 1.9g S 23 26.2 18070:55 mongod ...
$ uname -a Linux aluminum 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux
- There is another instance in this cluster where mongod is behaving as I would expect and utilizing all available memory.
- Looking at mongostat it looks like were consistently having some page-faulting, so the amount of memory used should be growing:
- (I asked this same question on the mongodb-user google group but got no response.)