资源描述:
《10 Key Performance Indicators for MongoDB》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ItAin'tTasseography10KeyPerformanceIndicatorsforMongoDBKyleBankerkyle@10gen.com@hwaetQuestionsaboutspeedMongoDBisahigh-performancedatabase,buthowdoIknowthatI'mgettingthebestperformance?We'llcover:ToolsPerformanceIndicatorsRemediesPrelude:Tools1.mongostat2.serverStatusdb.
2、serverStatus();{"host":"arete.local","version":"1.9.0-pre-","process":"mongod","uptime":619052}//Lotsmorestats....3.Profiler >db.setProfilingLevel(2){"was":0,"slowms":100,"ok":1}>db.system.profile.find().sort({$natural:-1}){"ts":ISODate("2011-05-24T14:20:09.711Z"),"info":
3、"querydocs.spreadsheetsreslen:257nscanned:1805535query:{query:{},$explain:true}nreturned:11407ms","millis":1407}4.MonitoringserviceNagiosMuninMMSIndicators1.SlowopsHere'showtheyappearinthelog:SunMay2219:01:47[conn10]querydocs.spreadsheetsntoreturn:100reslen:510436nscanne
4、d:19976{username:"Minner,Cori"}nreturned:100147ms2.Replicationlagtest-rs:PRIMARY>rs.status(){"set":"test-rs","date":ISODate("2011-05-24T14:19:35Z"),"myState":1,"members":[{"_id":0,"name":"localhost:30000","stateStr":"PRIMARY","optimeDate":ISODate("2011-05-18T19:19:26Z"),
5、},{"_id":1,"name":"localhost:30001","stateStr":"SECONDARY","optimeDate":ISODate("2011-05-22T14:14:29Z"),}}3.Residentmemory>db.serverStatus().mem{"bits":64,//Need64,not32"resident":7151,//Physicalmemory"virtual":14248,//Files+heap"mapped":6942//Datafiles}VirtualMemoryPhys
6、ical(PerProcess)MemoryRAMDiskusedocs>db.stats(){"db":"docs","collections":3,"objects":805543,"avgObjSize":5107.312096312674,"dataSize":4114159508,//~4GB"storageSize":4282908160,//~4GB"numExtents":33,"indexes":3,"indexSize":126984192,//~126MB"fileSize":8519680000,//~8.5GB
7、"ok":1}Note:fileSizeincludepre-allocation.storageSize+indexSize=~5GB4.Pagefaults>db.serverStatus().extra_info{"note":"fieldsvarybyplatform","heap_usage_bytes":210656,"page_faults":2381}5.Write-lockpercentage>db.serverStatus().globalLock{"totalTime":194616196335,"lockTime
8、":53865711,"ratio":0.000276779178785711,}ConcurrencyOnewriterORmanyreaders.Global.Yieldsonlong-runningo