We have two MongoDB data nodes (replica set) - Primary & Secondary. I noticed that the non-mapped virtual memory is relatively high and wondering if they are hurting our MongoDB performance (The server usually peaked at around 6-7K queries per sec).
In MMS, it was stated: "The most common case of usage of a high amount of memory for non-mapped is that there are very many connections to the database."
So we checked the memory usage with db.serverStatus().mem in our Secondary:
{
"bits" : 64,
"resident" : 6846,
"virtual" : 416797,
"supported" : true,
"mapped" : 205549,
"mappedWithJournal" : 411098,
"note" : "virtual minus mapped is large. could indicate a memory leak"
}
Note: We are using 2.0.4 and now the default stack size should be 1MB per connection.
The current number of connections is around 1.1K, but the non-mapped virtual memory (virtual-mappedWithJournal) is around 5699 MB. The trend is quite stable so I can't say there is a leak here, but where is the memory gone?
Any idea?
non-mapped virtual memoryis almost 1.5 to 2 times more than our PRIMARY, and the SECONDADY's loading is higher than the PRIMARY if they serve the same amount of traffic, so currently we still serve quite a lot of read in our PRIMARY. – tszming Sep 14 '12 at 12:08OBL. – tszming Sep 17 '12 at 02:58