mongodb - Mongo connection pooling and max connections -
my application running mongodb 2.4.8 using 2.11.2 version of java driver. end mongo taking cache on rhel when there many objects in database. 4gb of total 8gb cached. if try clear cache forcefully (as admin) using "sync; echo 3 > /proc/sys/vm/drop_caches" not clear cache, once stop mongo can clear cache using command. see 600+ connections mongo server using db.serverstatus().connections (i have 6 other app servers writing or reading data mongo server).
- is connection number causing heavy cache?
- even if not, should having these many connections database?
- currently connectionsperhost set 100 in code. high?
- can keep connectionsperhost 10 , threadsallowedtoblockforconnectionmultiplier 500? recommended?
thanks in advance
600 connections not unreasonable on mongod instance. in mongodb 2.4 limit 20k. while there cost in memory usage each connection should small. suggest following blog post more on mongodb connections: http://blog.mongolab.com/2013/11/deep-dive-into-connection-pooling/
it important note mongodb make use of memory available needed. part memory process resident memory. if see large file-system cache mongod data files readahead settings high. readahead mechanism disk access pull in additional blocks of sequential data - improving sequential i/o. not beneficial process performing random i/o case database systems. check please run:
- sudo blockdev --report
a readahead of 32 recommended starting point mongodb data filesystem. defaults higher - targeted towards sequential i/o rather random.
it important note filesystem cache usage - when high - should not concern. linux uses unused memory populate cache , should free if needed active processes.
as questions #3 & #4 - not tweak default settings unless needed. changing not reduce filesystem cache.
Comments
Post a Comment