Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Performance Tuning and Monitoring Using MMS

1,010 views

Published on

  • Be the first to comment

Performance Tuning and Monitoring Using MMS

  1. 1. Technical Support Manager, North America @ 10genNicholas Tang#MongoNYCPerformance Tuning andMonitoring Using MMS
  2. 2. Performance Tuning and Monitoring Using MMS, Nicholas TangAgenda• What is MMS?• Why use it?• Setting it up and getting around• Performance and monitoring (the fun stuff)• Wrap up
  3. 3. What is MMS?
  4. 4. Performance Tuning and Monitoring Using MMS, Nicholas TangWhat is MMS?• The MongoDB Monitoring Service: a freeservice (or software) for monitoring andmanagement
  5. 5. Performance Tuning and Monitoring Using MMS, Nicholas TangMetric collection andreporting
  6. 6. Performance Tuning and Monitoring Using MMS, Nicholas TangAlerting
  7. 7. Performance Tuning and Monitoring Using MMS, Nicholas TangEvent Tracking
  8. 8. Performance Tuning and Monitoring Using MMS, Nicholas TangLogs and Profile data
  9. 9. Performance Tuning and Monitoring Using MMS, Nicholas TangHardware stats (CPU, disk)
  10. 10. Performance Tuning and Monitoring Using MMS, Nicholas TangDB stats
  11. 11. Performance Tuning and Monitoring Using MMS, Nicholas TangBasic user management
  12. 12. What’s in it for me?
  13. 13. Performance Tuning and Monitoring Using MMS, Nicholas TangWhy?• Great high level view + detailed metrics• Low effort, high-return• Makes it easier for us to help you!• Makes you more attractive, promotes bonestrength and muscle tone ** - these last points still under review
  14. 14. How do I use this crazything?
  15. 15. Performance Tuning and Monitoring Using MMS, Nicholas TangSetting it uphttp://mms.10gen.com/help/monitoring/tutorial/• Setup an account• Install the agent• Add your hosts• Optional: hardware stats through munin-node• Optional: enable logging and profiling• More info:http://mms.10gen.com/help/monitoring/install/
  16. 16. Performance Tuning and Monitoring Using MMS, Nicholas TangNotes• Agent written in Python (moving to Go)• Failover: run multiple agents (1 primary)• Hosts: use CNAMEs, especially on AWS!• You can use a group per env (each needs anagent)• Connections are over SSL• On-Premise solution for Enterprise customersthat don’t want to use the hosted service
  17. 17. Performance tuningand monitoring
  18. 18. Performance Tuning and Monitoring Using MMS, Nicholas TangFinding the bottleneckSource:http://www.flickr.com/photos/laenulfean/462715479/
  19. 19. Performance Tuning and Monitoring Using MMS, Nicholas TangWhat is performance tuning?1. Assess the problem and establish acceptable behavior2. Measure the current performance3. Find the bottleneck*4. Remove the bottleneck5. Re-test to confirm6. Wash, rinse, repeat* - (This is the hard part)(Adapted from http://en.wikipedia.org/wiki/Performance_tuning )
  20. 20. Performance Tuning and Monitoring Using MMS, Nicholas TangPro-Tip: know thyselfYou have to recognize normal to know when itisn’t.Source:http://www.flickr.com/photos/skippy/6853920/
  21. 21. Performance Tuning and Monitoring Using MMS, Nicholas TangSome handy metrics to watch• Memory usage• Opcounters• Lock %• Queues• Background flush average• Replication stats
  22. 22. Performance Tuning and Monitoring Using MMS, Nicholas TangExample: replication lag150,000s of lag == almost 2 days of lag!
  23. 23. Performance Tuning and Monitoring Using MMS, Nicholas TangExample: replication lagSome common causes of replication lag:• Secondaries underspecced vs primaries• Access patterns between primary/ secondaries• Insufficient bandwidth• Foreground index builds on secondaries
  24. 24. Performance Tuning and Monitoring Using MMS, Nicholas TangFun fact: oplog idempotencyOperations in the oplog only affect the value once,so they can be run multiple times safely.Example: If you increment n from 2 to 3, n = 3 isfine; n + 1 is not.Frequent, large updates means a big oplog tosync.
  25. 25. Performance Tuning and Monitoring Using MMS, Nicholas TangExample: replication lag• Secondaries underspecced vs primaries• Access patterns between primary/ secondaries• Insufficient bandwidth• Foreground index builds on secondaries“…when you have eliminated the impossible,whatever remains,howeverimprobable,must be the truth…” -- Sherlock HolmesSirArthur Conan Doyle,The Sign of the Four
  26. 26. Performance Tuning and Monitoring Using MMS, Nicholas TangExample: replication lagExample:• ~1500 ops per minute (opcounters)• 0.1 MB per object (average object size, local db)~1500 ops/min / 60 seconds * 0.1 MB/op * 8b/B=~ 20 mbps required bandwidth
  27. 27. Performance Tuning and Monitoring Using MMS, Nicholas TangUse alerts!Don’t wait until your secondaries fall off your oplog!
  28. 28. Performance Tuning and Monitoring Using MMS, Nicholas TangExamining memory and diskMemory: resident vs virtual vs (non-)mapped
  29. 29. Performance Tuning and Monitoring Using MMS, Nicholas TangExamining memory and diskPage faults and Record Stats
  30. 30. Performance Tuning and Monitoring Using MMS, Nicholas TangExamining memory and diskBackground flush and Disk IO(Checkout http://www.wmarrow.com/strcalc/ )
  31. 31. Performance Tuning and Monitoring Using MMS, Nicholas TangMonitoring: watch forwarningsMMS warns you if your systems have startupwarnings or if they are running outdated versions.Don’t ignore these!
  32. 32. Wrapping up
  33. 33. Performance Tuning and Monitoring Using MMS, Nicholas TangWhat’s next?• Visual update - 3 weeks ago (June 3rd)• Backup service (join the queue!)• More UI/ UX improvements:– Enhanced dashboards– Improved cluster view
  34. 34. Performance Tuning and Monitoring Using MMS, Nicholas TangSummary• MMS is a great, free service• Setup is easy• Metrics are awesome, preventing failures evenmore awesome• There’s more functionality coming soon!
  35. 35. Performance Tuning and Monitoring Using MMS, Nicholas TangQuestions?• Ask me now…• …or check out our special Ask the Expertssession all about MMS and our new BackupService!
  36. 36. Performance Tuning and Monitoring with MMS, Nicholas TangNext Sessions at 11:555th Floor:West Side Ballroom 3&4: Basic Replication in MongoDBWest Side Ballroom 1&2: Advanced Sharding Features inMongoDB 2.4Juilliard Complex: Business Track: How Criteo Scaled andSupported Massive Growth with MongoDBLyceum Complex: Ask the Experts Online Education SessionEmpire Complex: Right Ways and Wrong Ways to ImplementMongoDBSoHo Complex: Automated Slow QueryAnalysis: Dex the IndexRobot

×