• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
mongoDB Performance
 

mongoDB Performance

on

  • 1,964 views

 

Statistics

Views

Total Views
1,964
Views on SlideShare
1,383
Embed Views
581

Actions

Likes
2
Downloads
0
Comments
2

34 Embeds 581

http://top-performance.blogspot.co.il 207
http://top-performance.blogspot.com 137
http://top-performance.blogspot.fr 44
http://top-performance.blogspot.in 39
http://top-performance.blogspot.dk 15
http://top-performance.blogspot.com.es 15
http://top-performance.blogspot.kr 15
http://top-performance.blogspot.de 13
http://top-performance.blogspot.ru 12
http://top-performance.blogspot.com.br 7
http://top-performance.blogspot.nl 7
http://top-performance.blogspot.co.uk 7
http://top-performance.blogspot.it 6
http://top-performance.blogspot.hk 6
http://top-performance.blogspot.com.au 5
http://top-performance.blogspot.be 5
http://top-performance.blogspot.ca 4
http://top-performance.blogspot.jp 4
http://top-performance.blogspot.tw 4
http://top-performance.blogspot.ch 4
http://top-performance.blogspot.fi 3
http://top-performance.blogspot.com.tr 3
http://top-performance.blogspot.pt 3
http://top-performance.blogspot.cz 3
http://top-performance.blogspot.ie 2
http://www.linkedin.com 2
http://top-performance.blogspot.hu 2
http://top-performance.blogspot.se 1
http://top-performance.blogspot.mx 1
http://top-performance.blogspot.com.ar 1
http://top-performance.blogspot.sg 1
http://top-performance.blogspot.ro 1
http://top-performance.blogspot.co.at 1
http://top-performance.blogspot.ae 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    mongoDB Performance mongoDB Performance Presentation Transcript

    • The VP R&D Open SeminarMongoDB PerformanceMoshe Kaplanmokplan@gmail.comhttp://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comWho is Using MongoDB?2
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comWho is Behind MongoDB?3
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com4Strategy A - Sharding
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com5Strategy B - In Memory Databases
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com6700 Inserts/SecIn Memory Engine3000 Inserts/SecInnoDB Engine700 Inserts/SecAmazonAWSStandardLargeInstance
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com7Strategy C – MapReducehttp://blogs.microsoft.co.il/blogs/vprnd
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comStrategy D - NoSQLinsertgetmultigetremovetruncate8<Key, Value>http://wiki.apache.org/cassandra/API
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.com9And now…http://www.webperformancetoday.com/2010/06/15/everything-you-wanted-to-know-about-web-performance/
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarMONGODB TUNING10
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comjournalCommitInterval = 300:Write to disk: 2ms <= t <= 300msDefault 100ms, increase to 300ms to saveresourcesDiskThe Journal11MemoryJournal Data1 2
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.commongod.conf TuningmaxConns: # of connection (<20,000)objcheck: BSON validation. false to saveoverhead.nohttpinterface = true: disables http interfacenoprealloc = false: preallocates space @ startupnoscripting = true: disables scripting engineprofile = 0: disable profilingrest = false: disable REST service12
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarSERVER STATS13
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comWhat we are facing of?> db.serverStatus().mem;> db.serverStatus().extra_info;> db.serverStatus().globalLock;> db.serverStatus().backgroundFlushing;> db.serverStatus().connections;> db.serverStatus().network;14RAMPage FaultsLock RatioI/O SpeedNot Too ManyBandwidth
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comRAM OptimizationdataSize + indexSize < RAM15OSData IndexJournal
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarPROFILING AND SLOW LOG16
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comProfiling ConfigurationEnable:• mongod --profile=1 --slowms=15• db.setProfilingLevel([level] , [time])How much:• 0 (none) 1 (slow queries only) 2 (all)• 100ms: defaultWhere:• system.profile collection17
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comProfiling Results AnalysisLast 5 >1ms: show profilew/o commands:db.system.profile.find( { op: { $ne : command } } ).pretty()Specific database:db.system.profile.find( { ns : mydb.test } ).pretty()Slower than:db.system.profile.find( { millis : { $gt : 5 } } ).pretty()Between dates:db.system.profile.find({ts : {$gt : new ISODate("2012-12-09T03:00:00Z") ,$lt : new ISODate("2012-12-09T03:40:00Z")}}).pretty()18
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comExplain> db.courses.find().explain();{ "cursor" : "BasicCursor","isMultiKey" : false,"n" : 11, “nscannedObjects" : 11,"nscanned" : 11, "nscannedObjectsAllPlans" : 11,"nscannedAllPlans" : 11,"scanAndOrder" : false, "indexOnly" : false,"nYields" : 0,"nChunkSkips" : 0,"millis" : 0,"indexBounds" : {},"server" : "primary.domain.com:27017"}19
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarINDEXES20
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comIndex ManagementRegular Indexdb.users.ensureIndex( { user_id: 1 } )Multiple + DESC Indexdb.users.ensureIndex( { user_id: 1, age: -1 } )Sub Document Indexdb.users.ensureIndex( { address.zipcode: 1 } )List Indexesdb.users.getIndexes()Drop Indexesdb.users.dropIndex(“indexName”)21
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comKnown Index IssuesBound filter should be the last(in the index as well).22
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarSTATS &SCHEMA DESIGN23
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comSparse Matrix? I don’t Think somongostat> db.stats();> db.collectionname.stats();Fragmentation if storageSize/size > 2db.collectionanme.runCommand(“compact”)Padding (wrong design) if paddingFactor > 224
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe VP R&D Open SeminarTHE LOCKING DILEMA25
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comLocking on Write (CRUD)2.0 Global Lock2.2 Database Lock2.X …What to do till then?26
    • http://blogs.microsoft.co.il/blogs/vprndhttp://top-performance.blogspot.comThe Startup Nation Feed27 Join @ InsideMy.co