SlideShare ist ein Scribd-Unternehmen logo
1 von 33
#MongoDBTokyo




Deployment
Preparedness
Alvin Richards
Technical Director, 10gen
Plan A because there is no Plan
B
             http://bit.ly/QlJULZ
Part One

Before you deploy…
Prototype

           Ops
        Playbook
                                Test

         Capacity
         Planning
                      Monitor




Reinventing the wheel
Essentials
• Disable NUMA
• Pick appropriate file-system (xfs, ext4)
• Pick 64-bit O/S
   – Recent Linux kernel, Win2k8R2

• More RAM
   – Spend on RAM not Cores

• Faster Disks
   – SSDs vs. SAN
   – Separate Journal and Data Files
Key things to consider
• Profiling
   – Baseline/Blue print: Understand what should happen
   – Ensure good Index usage

• Monitoring
   – SNMP, munin, zabix, cacti, nagios
   – MongoDB Monitoring Service (MMS)

• Sizing
   – Understand Capability (RAM, IOPs)
   – Understand Use Cases + Schema
What is your SLA?
• High Availability?
   – 24x7x365 operation?
   – Limited maintenance window?

• Data Protection?
   – Failure of a Single Node?
   – Failure of a Data Center?

• Disaster Recovery?
   – Manual or automatic failover?
   – Data Center, Region, Continent?
Build & Test your Playbook
• Backups
• Restores (backups are not enough)
• Upgrades
• Replica Set Operations
• Sharding Operations
Part Two

Under the cover…
How to see metrics
• mongostat
• MongoDB plug ins for
   – munin, zabix, cacti, ganglia

•Hosted Services
   – MMS - 10gen
   – Server Density, Cloudkick

• Profiling
Operation Counters
Metrics in detail: opcounters
• Counts:
 Insert, Update, Delete, Query, Commands
• Operation counters are mostly straightforward:
 more is better


• Some operations in a replica set primary are
 accounted differently in a secondary
• getlastError(), system.status etc are also
 counted
Resident Memory counter
Metrics in detail: resident
memory
• Key metric: to a very high degree, the
 performance of a mongod is a measure of how
 much data fits in RAM.


• If this quantity is stably lower than available
 physical memory, the mongod is likely
 performing well.
• Correlated metrics: page faults, B-Tree misses
Page Faults counter
Collection 1       Virtual                   Disk
                   Address
                   Space 1

                                  Physical
                                  RAM



  Index 1




                         100 ns
               =
                       10,000,000 ns
               =
Metrics in detail: page faults
• This measures reads or writes to pages of data
 file that aren't resident in memory
• If this is persistently non-zero, your data doesn't
 fit in memory.


• Correlated metrics: resident memory, B-Tree
 misses, iostats
Working Set
> db.blogs.stats()
{                                       Size of data
    "ns" : "test.blogs",
    "count" : 1338330,
    "size" : 46915928,                  Average
    "avgObjSize" : 35.05557523181876,   document size
    "storageSize" : 86092032,
    "numExtents" : 12,                  Size on disk (and
    "nindexes" : 2,                     in memory!)
    "lastExtentSize" : 20872960,
    "paddingFactor" : 1,
    "flags" : 0,
    "totalIndexSize" : 99860480,        Size of all
    "indexSizes" : {                    indexes
        "_id_" : 55877632,
        "name_1" : 43982848             Size of each
    },                                  index
    "ok" : 1
}
Lock % counter
Metrics in detail: lock
percentage and queues
• By itself, lock % can be misleading: a high lock
 percentage just means that writing is happening.


• But when lock % is high and queued readers or
 writers is non-zero, then the mongod probably at
 its write capacity.


• Correlated metrics: iostats
Log file
Mon Dec 3 15:05:37 [conn81]
getmore scaleout.nodes query: { ts: { $lte: new Date(1354547123142) } }
cursorid:8607875337747748011
ntoreturn:0
keyUpdates:0
numYields: 216
locks(micros) r:615830
nreturned:27055
reslen:4194349
551ms
explain, hint
// explain() shows the plan used by the operation
> db.c.find(<query>).explain()


// hint() forces a query to use a specific index
// x_1 is the name of the index from db.c.getIndexes()
> db.c.find( {x:1} ).hint("x_1")
B-Tree Counter
Metrics in detail: B-Tree
• Indicates b-tree accesses including page fault
 service during an index lookup
• If misses are persistently non-zero, your indexes
 don't fit in RAM. (You might need to change or
 drop indexes, or shard your data.)


• Correlated metrics: resident memory, page
 faults, iostats
B-Trees' strengths
• B-Tree indexes are designed for range queries
 over a single dimension


• Think of a compound index on { A, B } as being
 an index on the concatenation of the A and B
 values in documents


• MongoDB can use its indexes for sorting as well
B-Trees' weaknesses
• Ranges queries on the first field of a compound
 index are suboptimal
• Range queries over multiple dimensions are
 suboptimal
• In both these cases, a suboptimal index might
 be better than nothing, but best is to try to see if
 you can't change the problem
Indexing dark corners
• Some functionality can't currently always use
 indexes:
   – $where JavaScript clauses
   – $mod, $not, $ne
   – regex

• Negation maybe transformed into a range query
   – Index can be used

• Complicated regular expressions scan a whole
 index
Other tricks
Warming the Cache
> db.c.find( {unused_key: 1} ).explain()
> db.c.find( {unused_key: 1} )
   .hint( {random_index:1} )
   .explain()


# cat /data/db/* > /dev/null


// New in 2.2
> db.runCommand( { touch: "blogs",
           data: true, index: true } )
Journal on another disk
•The journal's write load is very different than the
data files
   – journal = append-only
   – data files = randomly accessed



•Putting the journal on a separate disk or RAID
(e.g., with a symlink) will minimize any seek-time
related journaling overhead
--directoryperdb
• Allows storage tiering
   – Different access patterns
   – Different Disk Types / Speeds


• use --directoryperdb
• add symlink into database directory
Dynamically change log level
// Change logging level to get more info


> db.adminCommand({ setParameter: 1, logLevel: 1 })


> db.adminCommand({ setParameter: 1, logLevel: 0 })
Because you now have a
Plan B
           http://bit.ly/QlJULZ

Weitere ähnliche Inhalte

Was ist angesagt?

Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Markus Höfer
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningMongoDB
 
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...DataStax
 
Google File System
Google File SystemGoogle File System
Google File SystemDreamJobs1
 
Spark & Cassandra - DevFest Córdoba
Spark & Cassandra - DevFest CórdobaSpark & Cassandra - DevFest Córdoba
Spark & Cassandra - DevFest CórdobaJose Mº Muñoz
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operationniallmilton
 
Intro to py spark (and cassandra)
Intro to py spark (and cassandra)Intro to py spark (and cassandra)
Intro to py spark (and cassandra)Jon Haddad
 
MongoDB for Time Series Data Part 3: Sharding
MongoDB for Time Series Data Part 3: ShardingMongoDB for Time Series Data Part 3: Sharding
MongoDB for Time Series Data Part 3: ShardingMongoDB
 
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016DataStax
 
Real time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.lyReal time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.lyVarun Vijayaraghavan
 
Tales from production with postgreSQL at scale
Tales from production with postgreSQL at scaleTales from production with postgreSQL at scale
Tales from production with postgreSQL at scaleSoumya Ranjan Subudhi
 
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)Spark Summit
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB RoadmapMongoDB
 
Design of Experiments on Federator Polystore Architecture
Design of Experiments on Federator Polystore ArchitectureDesign of Experiments on Federator Polystore Architecture
Design of Experiments on Federator Polystore ArchitectureLuiz Henrique Zambom Santana
 
PostgreSQL High_Performance_Cheatsheet
PostgreSQL High_Performance_CheatsheetPostgreSQL High_Performance_Cheatsheet
PostgreSQL High_Performance_CheatsheetLucian Oprea
 
Prácticas recomendadas en materia de arquitectura y errores que debes evitar
Prácticas recomendadas en materia de arquitectura y errores que debes evitarPrácticas recomendadas en materia de arquitectura y errores que debes evitar
Prácticas recomendadas en materia de arquitectura y errores que debes evitarElasticsearch
 
How We Used Cassandra/Solr to Build Real-Time Analytics Platform
How We Used Cassandra/Solr to Build Real-Time Analytics PlatformHow We Used Cassandra/Solr to Build Real-Time Analytics Platform
How We Used Cassandra/Solr to Build Real-Time Analytics PlatformDataStax Academy
 

Was ist angesagt? (20)

Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...
Deletes Without Tombstones or TTLs (Eric Stevens, ProtectWise) | Cassandra Su...
 
Google File System
Google File SystemGoogle File System
Google File System
 
Spark & Cassandra - DevFest Córdoba
Spark & Cassandra - DevFest CórdobaSpark & Cassandra - DevFest Córdoba
Spark & Cassandra - DevFest Córdoba
 
Memcached
MemcachedMemcached
Memcached
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operation
 
Intro to py spark (and cassandra)
Intro to py spark (and cassandra)Intro to py spark (and cassandra)
Intro to py spark (and cassandra)
 
MongoDB for Time Series Data Part 3: Sharding
MongoDB for Time Series Data Part 3: ShardingMongoDB for Time Series Data Part 3: Sharding
MongoDB for Time Series Data Part 3: Sharding
 
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
 
Intro to cassandra
Intro to cassandraIntro to cassandra
Intro to cassandra
 
Real time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.lyReal time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.ly
 
GFS & HDFS Introduction
GFS & HDFS IntroductionGFS & HDFS Introduction
GFS & HDFS Introduction
 
Tales from production with postgreSQL at scale
Tales from production with postgreSQL at scaleTales from production with postgreSQL at scale
Tales from production with postgreSQL at scale
 
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
Making Sense of Spark Performance-(Kay Ousterhout, UC Berkeley)
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
Design of Experiments on Federator Polystore Architecture
Design of Experiments on Federator Polystore ArchitectureDesign of Experiments on Federator Polystore Architecture
Design of Experiments on Federator Polystore Architecture
 
PostgreSQL High_Performance_Cheatsheet
PostgreSQL High_Performance_CheatsheetPostgreSQL High_Performance_Cheatsheet
PostgreSQL High_Performance_Cheatsheet
 
Prácticas recomendadas en materia de arquitectura y errores que debes evitar
Prácticas recomendadas en materia de arquitectura y errores que debes evitarPrácticas recomendadas en materia de arquitectura y errores que debes evitar
Prácticas recomendadas en materia de arquitectura y errores que debes evitar
 
How We Used Cassandra/Solr to Build Real-Time Analytics Platform
How We Used Cassandra/Solr to Build Real-Time Analytics PlatformHow We Used Cassandra/Solr to Build Real-Time Analytics Platform
How We Used Cassandra/Solr to Build Real-Time Analytics Platform
 

Andere mochten auch

MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013
MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013
MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013Daniel Moldovan
 
On Analyzing Elasticity Relationships of Cloud Services
On Analyzing Elasticity Relationships of Cloud ServicesOn Analyzing Elasticity Relationships of Cloud Services
On Analyzing Elasticity Relationships of Cloud ServicesDaniel Moldovan
 
B6 improve operational_efficiency_through_process_and_document_collaboration
B6 improve operational_efficiency_through_process_and_document_collaborationB6 improve operational_efficiency_through_process_and_document_collaboration
B6 improve operational_efficiency_through_process_and_document_collaborationDr. Wilfred Lin (Ph.D.)
 
Top 10 it infrastructure manager interview questions and answers
Top 10 it infrastructure manager interview questions and answersTop 10 it infrastructure manager interview questions and answers
Top 10 it infrastructure manager interview questions and answerskingjonhs
 
SharePoint Jumpstart #1 Creating a SharePoint Strategy
SharePoint Jumpstart #1 Creating a SharePoint StrategySharePoint Jumpstart #1 Creating a SharePoint Strategy
SharePoint Jumpstart #1 Creating a SharePoint StrategyEarley Information Science
 
How to Plan, Manage and Control SharePoint Projects
How to Plan, Manage and Control SharePoint Projects How to Plan, Manage and Control SharePoint Projects
How to Plan, Manage and Control SharePoint Projects Dux Raymond Sy
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationRandy Williams
 
Top 10 it infrastructure interview questions and answers
Top 10 it infrastructure interview questions and answersTop 10 it infrastructure interview questions and answers
Top 10 it infrastructure interview questions and answersAvrilLavigne888
 
World-Class Web Metrics by Dan Olsen
World-Class Web Metrics by Dan OlsenWorld-Class Web Metrics by Dan Olsen
World-Class Web Metrics by Dan OlsenDan Olsen
 
How to Manage Projects in SharePoint Using Out of the Box Features
How to Manage Projects in SharePoint Using Out of the Box FeaturesHow to Manage Projects in SharePoint Using Out of the Box Features
How to Manage Projects in SharePoint Using Out of the Box FeaturesGregory Zelfond
 
Building a Project Management Information System with SharePoint
Building a Project Management Information System with SharePointBuilding a Project Management Information System with SharePoint
Building a Project Management Information System with SharePointASPE, Inc.
 
Project Management System
Project Management SystemProject Management System
Project Management SystemDivyen Patel
 
How to implement SharePoint in your organization
How to implement SharePoint in your organizationHow to implement SharePoint in your organization
How to implement SharePoint in your organizationSPC Adriatics
 
Top 15 toughest interview questions with answers
Top 15 toughest interview questions with answersTop 15 toughest interview questions with answers
Top 15 toughest interview questions with answersjobguide247
 
Project Planning Basics - Everything you need to start managing a project
Project Planning Basics - Everything you need to start managing a projectProject Planning Basics - Everything you need to start managing a project
Project Planning Basics - Everything you need to start managing a projectKeely Killpack, PhD
 
Top 15 tips to prepare every job interviews
Top 15 tips to prepare every job interviewsTop 15 tips to prepare every job interviews
Top 15 tips to prepare every job interviewsjobguide247
 
Strategy Grand Tour
Strategy Grand TourStrategy Grand Tour
Strategy Grand Tourarvetica
 
We Are Social's Guide To Building A Connected Strategy
We Are Social's Guide To Building A Connected StrategyWe Are Social's Guide To Building A Connected Strategy
We Are Social's Guide To Building A Connected StrategyWe Are Social Singapore
 
Strategic Planning For Managers
Strategic Planning For Managers   Strategic Planning For Managers
Strategic Planning For Managers Yodhia Antariksa
 
Utilizing SharePoint for Project Management
Utilizing SharePoint for Project ManagementUtilizing SharePoint for Project Management
Utilizing SharePoint for Project ManagementGregory Zelfond
 

Andere mochten auch (20)

MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013
MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013
MELA: Monitoring and Analyzing Elasticity of Cloud Services -- CloudCom 2013
 
On Analyzing Elasticity Relationships of Cloud Services
On Analyzing Elasticity Relationships of Cloud ServicesOn Analyzing Elasticity Relationships of Cloud Services
On Analyzing Elasticity Relationships of Cloud Services
 
B6 improve operational_efficiency_through_process_and_document_collaboration
B6 improve operational_efficiency_through_process_and_document_collaborationB6 improve operational_efficiency_through_process_and_document_collaboration
B6 improve operational_efficiency_through_process_and_document_collaboration
 
Top 10 it infrastructure manager interview questions and answers
Top 10 it infrastructure manager interview questions and answersTop 10 it infrastructure manager interview questions and answers
Top 10 it infrastructure manager interview questions and answers
 
SharePoint Jumpstart #1 Creating a SharePoint Strategy
SharePoint Jumpstart #1 Creating a SharePoint StrategySharePoint Jumpstart #1 Creating a SharePoint Strategy
SharePoint Jumpstart #1 Creating a SharePoint Strategy
 
How to Plan, Manage and Control SharePoint Projects
How to Plan, Manage and Control SharePoint Projects How to Plan, Manage and Control SharePoint Projects
How to Plan, Manage and Control SharePoint Projects
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint Implementation
 
Top 10 it infrastructure interview questions and answers
Top 10 it infrastructure interview questions and answersTop 10 it infrastructure interview questions and answers
Top 10 it infrastructure interview questions and answers
 
World-Class Web Metrics by Dan Olsen
World-Class Web Metrics by Dan OlsenWorld-Class Web Metrics by Dan Olsen
World-Class Web Metrics by Dan Olsen
 
How to Manage Projects in SharePoint Using Out of the Box Features
How to Manage Projects in SharePoint Using Out of the Box FeaturesHow to Manage Projects in SharePoint Using Out of the Box Features
How to Manage Projects in SharePoint Using Out of the Box Features
 
Building a Project Management Information System with SharePoint
Building a Project Management Information System with SharePointBuilding a Project Management Information System with SharePoint
Building a Project Management Information System with SharePoint
 
Project Management System
Project Management SystemProject Management System
Project Management System
 
How to implement SharePoint in your organization
How to implement SharePoint in your organizationHow to implement SharePoint in your organization
How to implement SharePoint in your organization
 
Top 15 toughest interview questions with answers
Top 15 toughest interview questions with answersTop 15 toughest interview questions with answers
Top 15 toughest interview questions with answers
 
Project Planning Basics - Everything you need to start managing a project
Project Planning Basics - Everything you need to start managing a projectProject Planning Basics - Everything you need to start managing a project
Project Planning Basics - Everything you need to start managing a project
 
Top 15 tips to prepare every job interviews
Top 15 tips to prepare every job interviewsTop 15 tips to prepare every job interviews
Top 15 tips to prepare every job interviews
 
Strategy Grand Tour
Strategy Grand TourStrategy Grand Tour
Strategy Grand Tour
 
We Are Social's Guide To Building A Connected Strategy
We Are Social's Guide To Building A Connected StrategyWe Are Social's Guide To Building A Connected Strategy
We Are Social's Guide To Building A Connected Strategy
 
Strategic Planning For Managers
Strategic Planning For Managers   Strategic Planning For Managers
Strategic Planning For Managers
 
Utilizing SharePoint for Project Management
Utilizing SharePoint for Project ManagementUtilizing SharePoint for Project Management
Utilizing SharePoint for Project Management
 

Ähnlich wie Deployment Preparedness

M6d cassandrapresentation
M6d cassandrapresentationM6d cassandrapresentation
M6d cassandrapresentationEdward Capriolo
 
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Codemotion
 
Managing Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using ElasticsearchManaging Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using ElasticsearchJoe Alex
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101MongoDB
 
Avoiding big data antipatterns
Avoiding big data antipatternsAvoiding big data antipatterns
Avoiding big data antipatternsgrepalex
 
Storage talk
Storage talkStorage talk
Storage talkchristkv
 
Black friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchBlack friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchSylvain Wallez
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment StrategiesMongoDB
 
Fast and Scalable Python
Fast and Scalable PythonFast and Scalable Python
Fast and Scalable PythonTravis Oliphant
 
MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014Dylan Tong
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB RoadmapMongoDB
 
MongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment StrategyMongoDB
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at PollfishPollfish
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011bostonrb
 

Ähnlich wie Deployment Preparedness (20)

M6d cassandrapresentation
M6d cassandrapresentationM6d cassandrapresentation
M6d cassandrapresentation
 
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
 
Managing Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using ElasticsearchManaging Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using Elasticsearch
 
Percona FT / TokuDB
Percona FT / TokuDBPercona FT / TokuDB
Percona FT / TokuDB
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 
Cassandra training
Cassandra trainingCassandra training
Cassandra training
 
Avoiding big data antipatterns
Avoiding big data antipatternsAvoiding big data antipatterns
Avoiding big data antipatterns
 
Storage talk
Storage talkStorage talk
Storage talk
 
Black friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchBlack friday logs - Scaling Elasticsearch
Black friday logs - Scaling Elasticsearch
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment Strategies
 
Fast and Scalable Python
Fast and Scalable PythonFast and Scalable Python
Fast and Scalable Python
 
MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014MongoDB Sharding Webinar 2014
MongoDB Sharding Webinar 2014
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
MongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: ShardingMongoDB for Time Series Data: Sharding
MongoDB for Time Series Data: Sharding
 
MongoDB Basics Unileon
MongoDB Basics UnileonMongoDB Basics Unileon
MongoDB Basics Unileon
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment Strategy
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at Pollfish
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at Pollfish
 
mongodb tutorial
mongodb tutorialmongodb tutorial
mongodb tutorial
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
 

Mehr von 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
 

Mehr von 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...
 

Deployment Preparedness

  • 2. Plan A because there is no Plan B http://bit.ly/QlJULZ
  • 4. Prototype Ops Playbook Test Capacity Planning Monitor Reinventing the wheel
  • 5. Essentials • Disable NUMA • Pick appropriate file-system (xfs, ext4) • Pick 64-bit O/S – Recent Linux kernel, Win2k8R2 • More RAM – Spend on RAM not Cores • Faster Disks – SSDs vs. SAN – Separate Journal and Data Files
  • 6. Key things to consider • Profiling – Baseline/Blue print: Understand what should happen – Ensure good Index usage • Monitoring – SNMP, munin, zabix, cacti, nagios – MongoDB Monitoring Service (MMS) • Sizing – Understand Capability (RAM, IOPs) – Understand Use Cases + Schema
  • 7. What is your SLA? • High Availability? – 24x7x365 operation? – Limited maintenance window? • Data Protection? – Failure of a Single Node? – Failure of a Data Center? • Disaster Recovery? – Manual or automatic failover? – Data Center, Region, Continent?
  • 8. Build & Test your Playbook • Backups • Restores (backups are not enough) • Upgrades • Replica Set Operations • Sharding Operations
  • 10. How to see metrics • mongostat • MongoDB plug ins for – munin, zabix, cacti, ganglia •Hosted Services – MMS - 10gen – Server Density, Cloudkick • Profiling
  • 12. Metrics in detail: opcounters • Counts: Insert, Update, Delete, Query, Commands • Operation counters are mostly straightforward: more is better • Some operations in a replica set primary are accounted differently in a secondary • getlastError(), system.status etc are also counted
  • 14. Metrics in detail: resident memory • Key metric: to a very high degree, the performance of a mongod is a measure of how much data fits in RAM. • If this quantity is stably lower than available physical memory, the mongod is likely performing well. • Correlated metrics: page faults, B-Tree misses
  • 16. Collection 1 Virtual Disk Address Space 1 Physical RAM Index 1 100 ns = 10,000,000 ns =
  • 17. Metrics in detail: page faults • This measures reads or writes to pages of data file that aren't resident in memory • If this is persistently non-zero, your data doesn't fit in memory. • Correlated metrics: resident memory, B-Tree misses, iostats
  • 18. Working Set > db.blogs.stats() { Size of data "ns" : "test.blogs", "count" : 1338330, "size" : 46915928, Average "avgObjSize" : 35.05557523181876, document size "storageSize" : 86092032, "numExtents" : 12, Size on disk (and "nindexes" : 2, in memory!) "lastExtentSize" : 20872960, "paddingFactor" : 1, "flags" : 0, "totalIndexSize" : 99860480, Size of all "indexSizes" : { indexes "_id_" : 55877632, "name_1" : 43982848 Size of each }, index "ok" : 1 }
  • 20. Metrics in detail: lock percentage and queues • By itself, lock % can be misleading: a high lock percentage just means that writing is happening. • But when lock % is high and queued readers or writers is non-zero, then the mongod probably at its write capacity. • Correlated metrics: iostats
  • 21. Log file Mon Dec 3 15:05:37 [conn81] getmore scaleout.nodes query: { ts: { $lte: new Date(1354547123142) } } cursorid:8607875337747748011 ntoreturn:0 keyUpdates:0 numYields: 216 locks(micros) r:615830 nreturned:27055 reslen:4194349 551ms
  • 22. explain, hint // explain() shows the plan used by the operation > db.c.find(<query>).explain() // hint() forces a query to use a specific index // x_1 is the name of the index from db.c.getIndexes() > db.c.find( {x:1} ).hint("x_1")
  • 24. Metrics in detail: B-Tree • Indicates b-tree accesses including page fault service during an index lookup • If misses are persistently non-zero, your indexes don't fit in RAM. (You might need to change or drop indexes, or shard your data.) • Correlated metrics: resident memory, page faults, iostats
  • 25. B-Trees' strengths • B-Tree indexes are designed for range queries over a single dimension • Think of a compound index on { A, B } as being an index on the concatenation of the A and B values in documents • MongoDB can use its indexes for sorting as well
  • 26. B-Trees' weaknesses • Ranges queries on the first field of a compound index are suboptimal • Range queries over multiple dimensions are suboptimal • In both these cases, a suboptimal index might be better than nothing, but best is to try to see if you can't change the problem
  • 27. Indexing dark corners • Some functionality can't currently always use indexes: – $where JavaScript clauses – $mod, $not, $ne – regex • Negation maybe transformed into a range query – Index can be used • Complicated regular expressions scan a whole index
  • 29. Warming the Cache > db.c.find( {unused_key: 1} ).explain() > db.c.find( {unused_key: 1} ) .hint( {random_index:1} ) .explain() # cat /data/db/* > /dev/null // New in 2.2 > db.runCommand( { touch: "blogs", data: true, index: true } )
  • 30. Journal on another disk •The journal's write load is very different than the data files – journal = append-only – data files = randomly accessed •Putting the journal on a separate disk or RAID (e.g., with a symlink) will minimize any seek-time related journaling overhead
  • 31. --directoryperdb • Allows storage tiering – Different access patterns – Different Disk Types / Speeds • use --directoryperdb • add symlink into database directory
  • 32. Dynamically change log level // Change logging level to get more info > db.adminCommand({ setParameter: 1, logLevel: 1 }) > db.adminCommand({ setParameter: 1, logLevel: 0 })
  • 33. Because you now have a Plan B http://bit.ly/QlJULZ