SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
Deployment Best Practices
Sandeep Parikh
Solutions Architect, 10gen
Prototype


      Script               Test




          Scale      Monitor

The Cycle of Deployment Prep
Prototype




Prototype Your Deployment                        Script                     Test




                                                      Scale           Monitor




•  You have to start somewhere
•  Development is complete, deployment is next
•  Sketch out some initial deployment parameters
   ü Hardware sizing
   ü Operating system
   ü Disk setup
   ü Storage layout, data vs. journal vs. log
Prototype




Prototyping Considerations                                    Script                     Test




                                                                   Scale           Monitor




•  Additional considerations
   –  Horizontal vs. vertical scale options
   –  Multiple datacenters

•  Start thinking about data growth
   –  Do you know how your data will evolve?
   –  Does your data live in multiple collections/databases
   –  Read-centric, write-centric or both?

•  The more you start thinking about it, the better
Prototype




Test, Test, Test                                        Script                     Test




                                                             Scale           Monitor




•  Generate a lot of data
   –  Write tests to measure bulk loading throughput
   –  Scaffolding can be used for staging, validation

•  Build your indexes
   –  All in the beginning
   –  On the fly

•  Script your app
   –  Can you simulate “expected” usage?
Prototype




Monitor Your Resources                        Script                     Test




                                                   Scale           Monitor




•  Watch everything
•  The goal is to understand the numbers before
 deploying
•  Monitor using
   –  SNMP, munin, nagios
   –  mongostat, mongotop, iostat, cpustat
   –  MongoDB Monitoring Service (MMS)

•  Other stats
   –  Database, Collection level
Prototype




Monitoring Key Metrics                   Script                     Test




                                              Scale           Monitor




•  Op Counters
   –  Inserts, updates, deletes, reads
      (more is generally better)
   –  Some differences in primary
      vs. secondary ops

•  Resident memory
   –  Want this lower than
      available physical memory
   –  Correlated with page faults
      and index misses

•  Queues
   –  Readers and writers
Prototype




Monitoring Key Metrics                Script                     Test




                                           Scale           Monitor




•  Page faults and B-Tree
   –  How often are you having to
      hit the disk
   –  Persistently non-zero?
      Working set might not fit.

•  Lock Percentage
   –  If high and queues are filled,
     hitting write capacity

•  IO and CPU Stats
   –  IO Sustained or fluctuating
      => IO bound
   –  CPU hitting IOWAITs
Prototype




Scale Your Setup                           Script                     Test




                                                Scale           Monitor




•  Monitor those metrics while testing
•  Should tell you where to add capacity
   –  CPU, RAM, Disks

•  Storage configuration
   –  RAID levels
   –  Filesystem selection
   –  Block sizing
   –  Readahead setting
Prototype




Script Your Plays                                       Script                     Test




                                                             Scale           Monitor




•  Backups
•  Restores (backups are not enough)
•  Maintenance and Upgrades
•  Replica Set operations
   –  Stepping primaries down, adding new secondaries

•  Sharding operations
   –  Consistent backups, balancer operations
Prototype


       Script               Test




           Scale      Monitor

Lather, Rinse, Repeat
Perfect. I know what to do.
How Do I Do It?
Product     Infrastructure
        Development   Development



          Code

           QA         Monitoring

                      Operations
        Integration




Balancing Priorities
The Scale Tips To One Side
•  Product development is the priority
   –  As it should be, but…

•  Infrastructure development can’t be overlooked
•  Know the downsides of not being prepared
   –  Downtime
   –  Data safety

•  Disaster will strike in one way or another
Integrate With The Dev Cycle
•  Why are ops typically skipped over until it’s too
 late?
   –  Planning can alleviate this issue

•  Make operations development a part of the dev
 cycle
   –  Put it into the schedule
   –  Make it a development milestone

•  Use it to your advantage
   –  Script deployment of dev and test systems
That’s all well and good but
we are already deployed
Let’s Avoid This Situation
Prototype


       Script               Test




           Scale      Monitor

Start The Cycle Again
Prototype




Start With Monitoring                      Script                     Test




                                                Scale           Monitor




•  Monitor your deployment
   –  Munin, nagios
   –  MMS

•  Instrument your app
   –  Know your queries
   –  Read/write/update/delete behaviors
   –  Index utilization

•  Database and collection stats
Prototype




Scaling Deployment                                       Script                     Test




                                                              Scale           Monitor




•  The numbers don’t lie
   –  But individual measurements don’t always tell the whole
     story
•  Are you hardware bound?
   –  Memory, Disks, CPU

•  Is your app the problem?
•  What about system settings?
   –  Low Resident Memory > Readahead > Page Faults
Prototype




Basic Solutions                                             Script                     Test




                                                                 Scale           Monitor




•  Low opcounters + high page faults
   –  More memory

•  High paddingFactor and fragmentation
   –  Data model changes

•  Balancer running a lot, chunks always migrating
   –  Better shard key

•  Persistent b-tree misses, high page faults
   –  Queries aren’t hitting the indexes or aren’t using them
Prototype




Continue Through the Cycle                              Script                     Test




                                                             Scale           Monitor




•  Script your setup
   –  This will save time as you iterate

•  Prototype the fixes
   –  Evaluate queries, how documents change, expected usage

•  Test the new setup
   –  Scripts to build the deployment and model usage
Deployment is about
Not being surprised
Problem > Diagnosis > Solution
Problem 1: Streaming Events
•  Suboptimal write throughput
•  Where is the bottleneck?
   –  Check the metrics
Diagnosis 1
•  Are opcounters reasonably accurate?
•  Check the queues
•  Examine lock percentages
•  How does resident memory look?
•  How large are your indexes?
Solution 1
•  Opcounters aren’t as high as you’d expect but
 memory is saturated
•  Correlated with high page faults
•  You might need more memory
•  MongoDB wants to fit your working set into
 memory
Problem 2: Tracking FB Friends
•  Update-heavy workload is slow
•  Document paddingFactor is increasing
Diagnosis 2
•  High paddingFactor
   –  Fragmentation!

•  More memory/disk is taken up by new documents
   –  Inefficient space usage

•  Documents are having to be relocated regularly
Solution 2
•  Check your queries
   –  Are your documents growing because of arrays or added
     fields?
•  Pre-create required document structure or…
•  Kick growing elements individual objects in a
 separate collection
   –  Data model changes, app changes
Problem 3: Status Updates
•  Write-heavy sharded deployment
   –  Is one shard getting burned
   –  Balancer locked all the time

•  Balancer is constantly migrating chunks
Diagnosis 3
•  Check the mongos logs
   –  How often is migration occurring?
   –  Are chunks constantly moving from one shard to the next?

•  Shard key distribution
   –  Sequential keys?
   –  One shard always getting new writes?
Solution 3
•  Consider using hash, byte swapping, etc. if no
 “natural” key that distributes well
   –  Avoids the “hot” shard problem

•  High writes and high balancer lock
   –  Manage balancer window
   –  Run it during low utilization
Problem 4: File Sharing
•  Storing files in GridFS
•  Uploads are taking too long
Diagnosis 4
•  Check CPU and IO stats
•  Is the CPU stuck in IOWAITS?
•  High sustained IO operations
•  Lots of queued operations
•  IO bound workload
Solution 4
•  Ensure storage is in good health
   –  RAID status
   –  SAN or NAS devices functioning properly
   –  Virtualized disks

•  Consider separating data and journal
   –  --directoryperdb
   –  Symlink journal to another location

•  Ensure other processes aren’t hitting storage
Problem 5: Reading Logs
•  Indexes are underperforming
•  Queries are using indexes but yielding quite a bit
Diagnosis 5
•  Use .explain() and .hint() with your queries
•  Check out the b-tree metrics
   –  Persistent non-zero misses?
   –  Correlated with memory, page faults, IO stats

•  B-trees best for range queries over single
 dimension
   –  Range queries on {A} if index is {A,B} could be suboptimal
Solution 5
•  Revisit your indexing strategy
•  Consider data model changes to optimize queries
 and indexes
•  Some functionality doesn’t hit the index
   –  $where javascript clauses
   –  $mod, $not, $ne
   –  Complex regular expressions
Miscellaneous Deployment Notes
•  Warm the cache
   –  Use touch via db.runCommand()

•  Dynamically change log levels
•  Synchronize all clocks to the same NTP server
Questions?
How To Get Help
•  Refer to our docs: docs.mongodb.org
   –  (hint: they’re very helpful!)

•  Other things we monitor
   –  mongodb-user Google group
   –  Stack Overflow

•  Found a bug? Submit a ticket

Contenu connexe

En vedette

All Hope is Not Lost Network Forensics Exposes Today's Advanced Security Thr...
All Hope is Not LostNetwork Forensics Exposes Today's Advanced Security Thr...All Hope is Not LostNetwork Forensics Exposes Today's Advanced Security Thr...
All Hope is Not Lost Network Forensics Exposes Today's Advanced Security Thr...Savvius, Inc
 
You Suspect a Security Breach. Network Forensic Analysis Gives You the Answers
You Suspect a Security Breach. Network Forensic Analysis Gives You the AnswersYou Suspect a Security Breach. Network Forensic Analysis Gives You the Answers
You Suspect a Security Breach. Network Forensic Analysis Gives You the AnswersSavvius, Inc
 
Wireless LAN Deployment Best Practices
Wireless LAN Deployment Best PracticesWireless LAN Deployment Best Practices
Wireless LAN Deployment Best PracticesMichael Boman
 
Network Forensics Backwards and Forwards
Network Forensics Backwards and ForwardsNetwork Forensics Backwards and Forwards
Network Forensics Backwards and ForwardsSavvius, Inc
 
Network Analysis Tips & Tricks with Omnipeek
Network Analysis Tips & Tricks with OmnipeekNetwork Analysis Tips & Tricks with Omnipeek
Network Analysis Tips & Tricks with OmnipeekSavvius, Inc
 
Why Every Engineer Needs WLAN Packet Analysis
Why Every Engineer Needs WLAN Packet AnalysisWhy Every Engineer Needs WLAN Packet Analysis
Why Every Engineer Needs WLAN Packet AnalysisSavvius, Inc
 
Planning For Success - Wireless Network Design, Analysis, and Troubleshooting
Planning For Success - Wireless Network Design, Analysis, and TroubleshootingPlanning For Success - Wireless Network Design, Analysis, and Troubleshooting
Planning For Success - Wireless Network Design, Analysis, and TroubleshootingSavvius, Inc
 
Introducing Savvius Vigil
Introducing Savvius VigilIntroducing Savvius Vigil
Introducing Savvius VigilSavvius, Inc
 
Indicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradicationIndicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradicationMichael Boman
 
3GPP workshop - LTE in unlicensed spectrum
3GPP workshop - LTE in unlicensed spectrum 3GPP workshop - LTE in unlicensed spectrum
3GPP workshop - LTE in unlicensed spectrum Nadisanka Rupasinghe
 
44CON 2014: Using hadoop for malware, network, forensics and log analysis
44CON 2014: Using hadoop for malware, network, forensics and log analysis44CON 2014: Using hadoop for malware, network, forensics and log analysis
44CON 2014: Using hadoop for malware, network, forensics and log analysisMichael Boman
 

En vedette (12)

All Hope is Not Lost Network Forensics Exposes Today's Advanced Security Thr...
All Hope is Not LostNetwork Forensics Exposes Today's Advanced Security Thr...All Hope is Not LostNetwork Forensics Exposes Today's Advanced Security Thr...
All Hope is Not Lost Network Forensics Exposes Today's Advanced Security Thr...
 
You Suspect a Security Breach. Network Forensic Analysis Gives You the Answers
You Suspect a Security Breach. Network Forensic Analysis Gives You the AnswersYou Suspect a Security Breach. Network Forensic Analysis Gives You the Answers
You Suspect a Security Breach. Network Forensic Analysis Gives You the Answers
 
Wireless LAN Deployment Best Practices
Wireless LAN Deployment Best PracticesWireless LAN Deployment Best Practices
Wireless LAN Deployment Best Practices
 
Network Forensics Backwards and Forwards
Network Forensics Backwards and ForwardsNetwork Forensics Backwards and Forwards
Network Forensics Backwards and Forwards
 
Network Analysis Tips & Tricks with Omnipeek
Network Analysis Tips & Tricks with OmnipeekNetwork Analysis Tips & Tricks with Omnipeek
Network Analysis Tips & Tricks with Omnipeek
 
Why Every Engineer Needs WLAN Packet Analysis
Why Every Engineer Needs WLAN Packet AnalysisWhy Every Engineer Needs WLAN Packet Analysis
Why Every Engineer Needs WLAN Packet Analysis
 
Why WiFI Offload?
Why WiFI Offload?Why WiFI Offload?
Why WiFI Offload?
 
Planning For Success - Wireless Network Design, Analysis, and Troubleshooting
Planning For Success - Wireless Network Design, Analysis, and TroubleshootingPlanning For Success - Wireless Network Design, Analysis, and Troubleshooting
Planning For Success - Wireless Network Design, Analysis, and Troubleshooting
 
Introducing Savvius Vigil
Introducing Savvius VigilIntroducing Savvius Vigil
Introducing Savvius Vigil
 
Indicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradicationIndicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradication
 
3GPP workshop - LTE in unlicensed spectrum
3GPP workshop - LTE in unlicensed spectrum 3GPP workshop - LTE in unlicensed spectrum
3GPP workshop - LTE in unlicensed spectrum
 
44CON 2014: Using hadoop for malware, network, forensics and log analysis
44CON 2014: Using hadoop for malware, network, forensics and log analysis44CON 2014: Using hadoop for malware, network, forensics and log analysis
44CON 2014: Using hadoop for malware, network, forensics and log analysis
 

Similaire à Webinar: Deployment Best Practices

Ohio 2012-help-sysad-out
Ohio 2012-help-sysad-outOhio 2012-help-sysad-out
Ohio 2012-help-sysad-outmralexjuarez
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephenSteve Feldman
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerAndrew Siemer
 
Scaling apps for the big time
Scaling apps for the big timeScaling apps for the big time
Scaling apps for the big timeproitconsult
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLTriNimbus
 
Software Defects and SW Reliability Assessment
Software Defects and SW Reliability AssessmentSoftware Defects and SW Reliability Assessment
Software Defects and SW Reliability AssessmentKristine Hejna
 
Loadtesting wuc2009v2
Loadtesting wuc2009v2Loadtesting wuc2009v2
Loadtesting wuc2009v2ravneetraman
 
Capacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB ClusterCapacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB ClusterMongoDB
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comAviran Mordo
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!Richard Robinson
 
Mtc learnings from isv & enterprise interaction
Mtc learnings from isv & enterprise  interactionMtc learnings from isv & enterprise  interaction
Mtc learnings from isv & enterprise interactionGovind Kanshi
 
Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)Govind Kanshi
 
Webinar: Capacity Planning
Webinar: Capacity PlanningWebinar: Capacity Planning
Webinar: Capacity PlanningMongoDB
 
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015C2B2 Consulting
 
Mobile gotcha
Mobile gotchaMobile gotcha
Mobile gotchaphegaro
 
Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City Red Gate Software
 
Making security-agile matt-tesauro
Making security-agile matt-tesauroMaking security-agile matt-tesauro
Making security-agile matt-tesauroMatt Tesauro
 

Similaire à Webinar: Deployment Best Practices (20)

Ohio 2012-help-sysad-out
Ohio 2012-help-sysad-outOhio 2012-help-sysad-out
Ohio 2012-help-sysad-out
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
Scaling apps for the big time
Scaling apps for the big timeScaling apps for the big time
Scaling apps for the big time
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
 
Software Defects and SW Reliability Assessment
Software Defects and SW Reliability AssessmentSoftware Defects and SW Reliability Assessment
Software Defects and SW Reliability Assessment
 
Loadtesting wuc2009v2
Loadtesting wuc2009v2Loadtesting wuc2009v2
Loadtesting wuc2009v2
 
Capacityplanning
Capacityplanning Capacityplanning
Capacityplanning
 
Capacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB ClusterCapacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB Cluster
 
Becoming a better pen tester overview
Becoming a better pen tester overviewBecoming a better pen tester overview
Becoming a better pen tester overview
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
 
Mtc learnings from isv & enterprise interaction
Mtc learnings from isv & enterprise  interactionMtc learnings from isv & enterprise  interaction
Mtc learnings from isv & enterprise interaction
 
Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)
 
Webinar: Capacity Planning
Webinar: Capacity PlanningWebinar: Capacity Planning
Webinar: Capacity Planning
 
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
 
Mobile gotcha
Mobile gotchaMobile gotcha
Mobile gotcha
 
Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City
 
ApoorvaTiwari
ApoorvaTiwariApoorvaTiwari
ApoorvaTiwari
 
Making security-agile matt-tesauro
Making security-agile matt-tesauroMaking security-agile matt-tesauro
Making security-agile matt-tesauro
 

Plus de MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump StartMongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB
 

Plus de MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Dernier

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 

Dernier (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 

Webinar: Deployment Best Practices

  • 1. Deployment Best Practices Sandeep Parikh Solutions Architect, 10gen
  • 2. Prototype Script Test Scale Monitor The Cycle of Deployment Prep
  • 3. Prototype Prototype Your Deployment Script Test Scale Monitor •  You have to start somewhere •  Development is complete, deployment is next •  Sketch out some initial deployment parameters ü Hardware sizing ü Operating system ü Disk setup ü Storage layout, data vs. journal vs. log
  • 4. Prototype Prototyping Considerations Script Test Scale Monitor •  Additional considerations –  Horizontal vs. vertical scale options –  Multiple datacenters •  Start thinking about data growth –  Do you know how your data will evolve? –  Does your data live in multiple collections/databases –  Read-centric, write-centric or both? •  The more you start thinking about it, the better
  • 5. Prototype Test, Test, Test Script Test Scale Monitor •  Generate a lot of data –  Write tests to measure bulk loading throughput –  Scaffolding can be used for staging, validation •  Build your indexes –  All in the beginning –  On the fly •  Script your app –  Can you simulate “expected” usage?
  • 6. Prototype Monitor Your Resources Script Test Scale Monitor •  Watch everything •  The goal is to understand the numbers before deploying •  Monitor using –  SNMP, munin, nagios –  mongostat, mongotop, iostat, cpustat –  MongoDB Monitoring Service (MMS) •  Other stats –  Database, Collection level
  • 7. Prototype Monitoring Key Metrics Script Test Scale Monitor •  Op Counters –  Inserts, updates, deletes, reads (more is generally better) –  Some differences in primary vs. secondary ops •  Resident memory –  Want this lower than available physical memory –  Correlated with page faults and index misses •  Queues –  Readers and writers
  • 8. Prototype Monitoring Key Metrics Script Test Scale Monitor •  Page faults and B-Tree –  How often are you having to hit the disk –  Persistently non-zero? Working set might not fit. •  Lock Percentage –  If high and queues are filled, hitting write capacity •  IO and CPU Stats –  IO Sustained or fluctuating => IO bound –  CPU hitting IOWAITs
  • 9. Prototype Scale Your Setup Script Test Scale Monitor •  Monitor those metrics while testing •  Should tell you where to add capacity –  CPU, RAM, Disks •  Storage configuration –  RAID levels –  Filesystem selection –  Block sizing –  Readahead setting
  • 10. Prototype Script Your Plays Script Test Scale Monitor •  Backups •  Restores (backups are not enough) •  Maintenance and Upgrades •  Replica Set operations –  Stepping primaries down, adding new secondaries •  Sharding operations –  Consistent backups, balancer operations
  • 11. Prototype Script Test Scale Monitor Lather, Rinse, Repeat
  • 12. Perfect. I know what to do. How Do I Do It?
  • 13. Product Infrastructure Development Development Code QA Monitoring Operations Integration Balancing Priorities
  • 14. The Scale Tips To One Side •  Product development is the priority –  As it should be, but… •  Infrastructure development can’t be overlooked •  Know the downsides of not being prepared –  Downtime –  Data safety •  Disaster will strike in one way or another
  • 15. Integrate With The Dev Cycle •  Why are ops typically skipped over until it’s too late? –  Planning can alleviate this issue •  Make operations development a part of the dev cycle –  Put it into the schedule –  Make it a development milestone •  Use it to your advantage –  Script deployment of dev and test systems
  • 16. That’s all well and good but we are already deployed
  • 17. Let’s Avoid This Situation
  • 18. Prototype Script Test Scale Monitor Start The Cycle Again
  • 19. Prototype Start With Monitoring Script Test Scale Monitor •  Monitor your deployment –  Munin, nagios –  MMS •  Instrument your app –  Know your queries –  Read/write/update/delete behaviors –  Index utilization •  Database and collection stats
  • 20. Prototype Scaling Deployment Script Test Scale Monitor •  The numbers don’t lie –  But individual measurements don’t always tell the whole story •  Are you hardware bound? –  Memory, Disks, CPU •  Is your app the problem? •  What about system settings? –  Low Resident Memory > Readahead > Page Faults
  • 21. Prototype Basic Solutions Script Test Scale Monitor •  Low opcounters + high page faults –  More memory •  High paddingFactor and fragmentation –  Data model changes •  Balancer running a lot, chunks always migrating –  Better shard key •  Persistent b-tree misses, high page faults –  Queries aren’t hitting the indexes or aren’t using them
  • 22. Prototype Continue Through the Cycle Script Test Scale Monitor •  Script your setup –  This will save time as you iterate •  Prototype the fixes –  Evaluate queries, how documents change, expected usage •  Test the new setup –  Scripts to build the deployment and model usage
  • 23. Deployment is about Not being surprised
  • 24. Problem > Diagnosis > Solution
  • 25. Problem 1: Streaming Events •  Suboptimal write throughput •  Where is the bottleneck? –  Check the metrics
  • 26. Diagnosis 1 •  Are opcounters reasonably accurate? •  Check the queues •  Examine lock percentages •  How does resident memory look? •  How large are your indexes?
  • 27. Solution 1 •  Opcounters aren’t as high as you’d expect but memory is saturated •  Correlated with high page faults •  You might need more memory •  MongoDB wants to fit your working set into memory
  • 28. Problem 2: Tracking FB Friends •  Update-heavy workload is slow •  Document paddingFactor is increasing
  • 29. Diagnosis 2 •  High paddingFactor –  Fragmentation! •  More memory/disk is taken up by new documents –  Inefficient space usage •  Documents are having to be relocated regularly
  • 30. Solution 2 •  Check your queries –  Are your documents growing because of arrays or added fields? •  Pre-create required document structure or… •  Kick growing elements individual objects in a separate collection –  Data model changes, app changes
  • 31. Problem 3: Status Updates •  Write-heavy sharded deployment –  Is one shard getting burned –  Balancer locked all the time •  Balancer is constantly migrating chunks
  • 32. Diagnosis 3 •  Check the mongos logs –  How often is migration occurring? –  Are chunks constantly moving from one shard to the next? •  Shard key distribution –  Sequential keys? –  One shard always getting new writes?
  • 33. Solution 3 •  Consider using hash, byte swapping, etc. if no “natural” key that distributes well –  Avoids the “hot” shard problem •  High writes and high balancer lock –  Manage balancer window –  Run it during low utilization
  • 34. Problem 4: File Sharing •  Storing files in GridFS •  Uploads are taking too long
  • 35. Diagnosis 4 •  Check CPU and IO stats •  Is the CPU stuck in IOWAITS? •  High sustained IO operations •  Lots of queued operations •  IO bound workload
  • 36. Solution 4 •  Ensure storage is in good health –  RAID status –  SAN or NAS devices functioning properly –  Virtualized disks •  Consider separating data and journal –  --directoryperdb –  Symlink journal to another location •  Ensure other processes aren’t hitting storage
  • 37. Problem 5: Reading Logs •  Indexes are underperforming •  Queries are using indexes but yielding quite a bit
  • 38. Diagnosis 5 •  Use .explain() and .hint() with your queries •  Check out the b-tree metrics –  Persistent non-zero misses? –  Correlated with memory, page faults, IO stats •  B-trees best for range queries over single dimension –  Range queries on {A} if index is {A,B} could be suboptimal
  • 39. Solution 5 •  Revisit your indexing strategy •  Consider data model changes to optimize queries and indexes •  Some functionality doesn’t hit the index –  $where javascript clauses –  $mod, $not, $ne –  Complex regular expressions
  • 40. Miscellaneous Deployment Notes •  Warm the cache –  Use touch via db.runCommand() •  Dynamically change log levels •  Synchronize all clocks to the same NTP server
  • 42. How To Get Help •  Refer to our docs: docs.mongodb.org –  (hint: they’re very helpful!) •  Other things we monitor –  mongodb-user Google group –  Stack Overflow •  Found a bug? Submit a ticket