0

I am using Mongo Replica set and it seems to be working fine but when i check db.serverStatus i saw that there are lots of accessesNotInMemory for all The DBs in my mongo instance.

I checked MY RAM and the configuration is as follows:
RAM size : 32 GB
Total Indexes in all DBs : 12 GB
Data in all DBs : 80 GB
Top command shows me 18 GB memory uses and Mongo process is using 51% of available memory.

Could you please tell em why I am getting these accessesNotInMemory even so much memory is still free.
More about my application is writes user activity on my website.
I have two systems in place at DB.
1. Sharded Set UP : Set takes all load for each write operation.
2. Processed Data Set UP: Store Data resulted from various aggregation script.

Here I am talking about second set up which takes data at each hour when my aggregation script run.
So here is the sue case for this:
1. Data inserted/Updated in various logical DBs at every hour.
2. All read APIs served through this MongoD instance.
3. No Direct/ frequent write is done on the DB.

I made some changes in my APIs to reduce index overhead for sorting purpose. I am not sorting data in DB query i pull it for the query range and sort it in java.

This is my application behaviour.

TOP command output

top - 10:41:20 up 38 days, 20:05,  3 users,  load average: 0.00, 0.00, 0.00  
Tasks: 175 total,   1 running, 174 sleeping,   0 stopped,   0 zombie  
Cpu(s):  0.1%us,  0.1%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st  
Mem:  33103424k total, 18615444k used, 14487980k free,   243916k buffers  
Swap:  3884024k total,    63524k used,  3820500k free, 16571920k cached  

PID   USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND  
3700  root      20   0  157g  16g  16g S  2.0 52.9   1378:56 mongod

serverStatus output

firstset:PRIMARY> db.serverStatus({workingSet:1});
{
    "host" : "MongoDB33209",
    "version" : "2.6.4",
    "process" : "mongod",
    "pid" : NumberLong(3700),
    "uptime" : 3344876,
    "uptimeMillis" : NumberLong("3344876756"),
    "uptimeEstimate" : 3297769,
    "localTime" : ISODate("2015-02-27T05:12:09.797Z"),
    "asserts" : {
            "regular" : 0,
            "warning" : 0,
            "msg" : 0,
            "user" : 169,
            "rollovers" : 0
    },
    "backgroundFlushing" : {
            "flushes" : 55747,
            "total_ms" : 3522610,
            "average_ms" : 63.18922991371733,
            "last_ms" : 13,
            "last_finished" : ISODate("2015-02-27T05:11:26.453Z")
    },
    "connections" : {
            "current" : 32,
            "available" : 19968,
            "totalCreated" : NumberLong(253960)
    },
    "cursors" : {
            "note" : "deprecated, use server status metrics",
            "clientCursors_size" : 1,
            "totalOpen" : 1,
            "pinned" : 0,
            "totalNoTimeout" : 8,
            "timedOut" : 137
    },
    "dur" : {
            "commits" : 30,
            "journaledMB" : 0,
            "writeToDataFilesMB" : 0,
            "compression" : 0,
            "commitsInWriteLock" : 0,
            "earlyCommits" : 0,
            "timeMs" : {
                    "dt" : 3073,
                    "prepLogBuffer" : 0,
                    "writeToJournal" : 0,
                    "writeToDataFiles" : 0,
                    "remapPrivateView" : 0
            }
    },
    "extra_info" : {
            "note" : "fields vary by platform",
            "heap_usage_bytes" : 217828936,
            "page_faults" : 7206470
    },
    "globalLock" : {
            "totalTime" : NumberLong("3344876757000"),
            "lockTime" : NumberLong("4239567675"),
            "currentQueue" : {
                    "total" : 0,
                    "readers" : 0,
                    "writers" : 0
            },
            "activeClients" : {
                    "total" : 0,
                    "readers" : 0,
                    "writers" : 0
            }
    },
    "indexCounters" : {
            "accesses" : 3716993293,
            "hits" : 3716993312,
            "misses" : 0,
            "resets" : 0,
            "missRatio" : 0
    },
    "locks" : {
            "." : {
                    "timeLockedMicros" : {
                            "R" : NumberLong(580972483),
                            "W" : NumberLong("4239567675")
                    },
                    "timeAcquiringMicros" : {
                            "R" : NumberLong("17175041218"),
                            "W" : NumberLong(1530253880)
                    }
            },
            "admin" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(4113636),
                            "w" : NumberLong(0)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(221171),
                            "w" : NumberLong(0)
                    }
            },
            "local" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(877458682),
                            "w" : NumberLong("4483497401")
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong("56622055369"),
                            "w" : NumberLong("5434791334")
                    }
            },
            "ProcessDB" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong("8406271110"),
                            "w" : NumberLong("11271116631")
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong("39367371311"),
                            "w" : NumberLong(374059462)
                    }
            },
            "Month" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(377),
                            "w" : NumberLong(0)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(12891),
                            "w" : NumberLong(0)
                    }
            },
            "test" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(1084729),
                            "w" : NumberLong(0)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(220763),
                            "w" : NumberLong(0)
                    }
            },
            "Author" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(9542350),
                            "w" : NumberLong(103769)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(2776615),
                            "w" : NumberLong(2249)
                    }
            },
            "MonthDB" : {
                    "timeLockedMicros" : {
                            "R" : NumberLong(38255),
                            "W" : NumberLong(0),
                            "r" : NumberLong(575420785),
                            "w" : NumberLong("9184847978")
                    },
                    "timeAcquiringMicros" : {
                            "R" : NumberLong(301940),
                            "W" : NumberLong(0),
                            "r" : NumberLong(108467712),
                            "w" : NumberLong(530000052)
                    }
            },
            "DateDB" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(289821),
                            "w" : NumberLong(0)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(81323),
                            "w" : NumberLong(0)
                    }
            },
            "History" : {
                    "timeLockedMicros" : {
                            "R" : NumberLong(38311),
                            "W" : NumberLong(0),
                            "r" : NumberLong("5662251982"),
                            "w" : NumberLong("22748548802")
                    },
                    "timeAcquiringMicros" : {
                            "R" : NumberLong(461922),
                            "W" : NumberLong(0),
                            "r" : NumberLong("2213086691"),
                            "w" : NumberLong(791624945)
                    }
            },
            "analytics" : {
                    "timeLockedMicros" : {
                            "r" : NumberLong(22922884),
                            "w" : NumberLong(340925)
                    },
                    "timeAcquiringMicros" : {
                            "r" : NumberLong(1668266970),
                            "w" : NumberLong(25641)
                    }
            },
            "Week" : {
                    "timeLockedMicros" : {
                            "R" : NumberLong(20),
                            "W" : NumberLong(0),
                            "r" : NumberLong(487853692),
                            "w" : NumberLong("9679431619")
                    },
                    "timeAcquiringMicros" : {
                            "R" : NumberLong(421116),
                            "W" : NumberLong(0),
                            "r" : NumberLong(268862498),
                            "w" : NumberLong(732862695)
                    }
            }
    },
    "network" : {
            "bytesIn" : 68321919874,
            "bytesOut" : 78858702480,
            "numRequests" : 205834437
    },
    "opcounters" : {
            "insert" : 114008924,
            "query" : 467646,
            "update" : 87192211,
            "delete" : 1,
            "getmore" : 10010301,
            "command" : 24489356
    },
    "opcountersRepl" : {
            "insert" : 0,
            "query" : 0,
            "update" : 0,
            "delete" : 0,
            "getmore" : 0,
            "command" : 0
    },
    "recordStats" : {
            "accessesNotInMemory" : 1258276,
            "pageFaultExceptionsThrown" : 5,
            "admin" : {
                    "accessesNotInMemory" : 0,
                    "pageFaultExceptionsThrown" : 0
            },
            "analytics" : {
                    "accessesNotInMemory" : 22,
                    "pageFaultExceptionsThrown" : 0
            },
            "Author" : {
                    "accessesNotInMemory" : 0,
                    "pageFaultExceptionsThrown" : 0
            },
            "History" : {
                    "accessesNotInMemory" : 11482,
                    "pageFaultExceptionsThrown" : 0
            },
            "MonthDB" : {
                    "accessesNotInMemory" : 94981,
                    "pageFaultExceptionsThrown" : 0
            },
            "ProcessDB" : {
                    "accessesNotInMemory" : 223495,
                    "pageFaultExceptionsThrown" : 1
            },
            "Week" : {
                    "accessesNotInMemory" : 56823,
                    "pageFaultExceptionsThrown" : 4
            },
            "local" : {
                    "accessesNotInMemory" : 144146,
                    "pageFaultExceptionsThrown" : 0
            },
            "test" : {
                    "accessesNotInMemory" : 0,
                    "pageFaultExceptionsThrown" : 0
            }
    },
    "repl" : {
            "setName" : "firstset",
            "setVersion" : 3,
            "ismaster" : true,
            "secondary" : false,
            "hosts" : [
                    "192.168.33.209:27017",
                    "192.168.33.210:27017"
            ],
            "arbiters" : [
                    "192.168.33.211:27017"
            ],
            "primary" : "192.168.33.209:27017",
            "me" : "192.168.33.209:27017"
    },
    "workingSet" : {
            "note" : "thisIsAnEstimate",
            "pagesInMemory" : 141578,
            "computationTimeMicros" : 61338,
            "overSeconds" : 1265
    },
    "writeBacksQueued" : false,
    "mem" : {
            "bits" : 64,
            "resident" : 17115,
            "virtual" : 161640,
            "supported" : true,
            "mapped" : 79885,
            "mappedWithJournal" : 159770
    },
    "metrics" : {
            "cursor" : {
                    "timedOut" : NumberLong(137),
                    "open" : {
                            "noTimeout" : NumberLong(8),
                            "pinned" : NumberLong(0),
                            "total" : NumberLong(1)
                    }
            },
            "document" : {
                    "deleted" : NumberLong(30605),
                    "inserted" : NumberLong(114008924),
                    "returned" : NumberLong(258188745),
                    "updated" : NumberLong(87192211)
            },
            "getLastError" : {
                    "wtime" : {
                            "num" : 0,
                            "totalMillis" : 0
                    },
                    "wtimeouts" : NumberLong(0)
            },
            "operation" : {
                    "fastmod" : NumberLong(32233943),
                    "idhack" : NumberLong(0),
                    "scanAndOrder" : NumberLong(4)
            },
            "queryExecutor" : {
                    "scanned" : NumberLong("464652125632"),
                    "scannedObjects" : NumberLong(209424414)
            },
            "record" : {
                    "moves" : NumberLong(1207213)
            },
            "repl" : {
                    "apply" : {
                            "batches" : {
                                    "num" : 0,
                                    "totalMillis" : 0
                            },
                            "ops" : NumberLong(0)
                    },
                    "buffer" : {
                            "count" : NumberLong(0),
                            "maxSizeBytes" : 268435456,
                            "sizeBytes" : NumberLong(0)
                    },
                    "network" : {
                            "bytes" : NumberLong(0),
                            "getmores" : {
                                    "num" : 0,
                                    "totalMillis" : 0
                            },
                            "ops" : NumberLong(0),
                            "readersCreated" : NumberLong(22)
                    },
                    "preload" : {
                            "docs" : {
                                    "num" : 0,
                                    "totalMillis" : 0
                            },
                            "indexes" : {
                                    "num" : 0,
                                    "totalMillis" : 0
                            }
                    }
            },
            "storage" : {
                    "freelist" : {
                            "search" : {
                                    "bucketExhausted" : NumberLong(0),
                                    "requests" : NumberLong(168481860),
                                    "scanned" : NumberLong(335886028)
                            }
                    }
            },
            "ttl" : {
                    "deletedDocuments" : NumberLong(0),
                    "passes" : NumberLong(55658)
            }
    },
    "ok" : 1
}
  • So the specific "use case" here is what? Please give something to give context to. Also please consider that stackoverflow.com might be better with more information. – Neil Lunn Feb 26 '15 at 10:56
  • The issue seems to be related to Database that's why I put it here. And specific use case is not so specific as these are databases which has collections. I have 4 DBs in this mongo instance. I checked the Index size to calculate my RAM requirements as Mongo suggest that your index should fit in Ram to avoid disc read. Could you please explain me what more input you need. – viren Feb 26 '15 at 11:22
  • Or perhaps you should "read" that you supplied no information whatsoever as to what your application is actually doing to cause this. So perhaps you should learn something from those who really do "know better" than you "the person who needs to ask questions" and take the advice that is given rather than argue? You know, perhaps! – Neil Lunn Feb 26 '15 at 12:06
  • @NeilLunn sorry for late reply and please do not take my comment as argument as i am trying to understand the points from you side which can my use case to you in better way i know then only you will be able to help me. I have updated my question with my application detail specially for this particular MongoD instance.IF you need more input please let me know i will provide details as per you need to investigate the issue. – viren Feb 27 '15 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.