capacity planning

45
Solutions Architect, 10gen Asya Kamsky #MongoDBDays Capacity Planning: Deploying MongoDB

Upload: mongodb

Post on 06-Jul-2015

3.191 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Capacity Planning

Solutions Architect, 10gen Asya Kamsky

#MongoDBDays

Capacity Planning: Deploying MongoDB

Page 2: Capacity Planning

Solutions Architect, 10gen Asya Kamsky

#MongoDBDays

Capacity Planning: Deploying MongoDB

Page 3: Capacity Planning

Capacity Planning: Why, What, When

•  Don't be the "goat" – spent too much $ or caused failure of site, etc.

•  Users frequently ask about HW they need for their application. What does 10gen "recommend"?

•  No right answer in a vacuum.

•  Why we need to plan to meet expectations, etc. –  future planning •  data increases, don't want performance drop-off

Capacity Planning, Asya Kamsky, 10gen

Page 4: Capacity Planning

What are the consequences of not planning?

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Why?

Page 5: Capacity Planning

Why

•  Once we launch, we don't want to have avoidable down time due to poorly selected HW

•  As our success grows we want to stay in front of the demand curve

•  We want to meet business' and users' expectations

•  We want to keep our jobs J

•  and get big raises! ;)

Capacity Planning, Asya Kamsky, 10gen

Page 6: Capacity Planning

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Why? What are the consequences of not planning?

Page 7: Capacity Planning

Why

•  We want to keep our jobs J

•  and get big raises! ;)

•  so we should stay within reasonable budget

Capacity Planning, Asya Kamsky, 10gen

Page 8: Capacity Planning

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Requirements

What? Why?

Page 9: Capacity Planning

What

•  There is one thing that is absolutely mandatory to have in order to succeed in capacity planning

•  Without it, you will not be successful

•  We must have REQUIREMENTS from business –  without requirements, we're building a roadmap without

knowing the desired destination Imagine building a car without knowing what its top speed should be, acceleration, MPH, and cost?

Capacity Planning, Asya Kamsky, 10gen

Page 10: Capacity Planning

•  Availability •  Throughput •  Responsiveness

What?

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Page 11: Capacity Planning

What

•  Availability: what is uptime requirement?

•  Throughput –  average read/write/users –  peak throughput? –  OPS (operations per second)? per hour? per day?

•  Responsiveness –  what is acceptable latency? –  is higher during peak times acceptable?

Capacity Planning, Asya Kamsky, 10gen

Page 12: Capacity Planning

•  Availability •  Throughput •  Responsiveness

What?

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Page 13: Capacity Planning

Before it's too late!

When?

Capacity Planning: Why, What, When

Capacity Planning, Asya Kamsky, 10gen

Start Launch Version 2

Page 14: Capacity Planning

Capacity Planning: Why?

•  Capacity –  Under –  Over –  Just right?

•  Prediction Models –  User/Load –  System(s) Behavior

•  Change Velocity (reaction time) –  Data/Resource-Allocation/Provisioning

Capacity Planning, Asya Kamsky, 10gen

Page 15: Capacity Planning

Capacity Planning: What? •  Understand Resources

–  Storage –  Memory –  CPU –  Network

Capacity Planning, Asya Kamsky, 10gen

•  Understand Your Application –  Monitor and Collect Metrics –  Model to Predict Change –  Allocate and Deploy –  (repeat process)

Page 16: Capacity Planning

Resource Usage

•  Storage –  IOPS –  Size –  Data & Loading Patterns

•  Memory

–  Working Set

•  CPU –  Speed –  Cores

•  Network –  Latency –  Throughput

Capacity Planning, Asya Kamsky, 10gen

Page 17: Capacity Planning

Storage

• Active • Archival • Loading Patterns •  Integration (BI/DW)

Capacity Planning, Asya Kamsky, 10gen

Page 18: Capacity Planning

Storage

• Active • Archival • Loading Patterns •  Integration (BI/DW)

Capacity Planning, Asya Kamsky, 10gen

Example IOPS

Page 19: Capacity Planning

Example IOPS 7,200 rpm SATA ~ 75-100 IOPS

15,000 rpm SAS ~ 175-210 IOPS

Amazon EBS/Provisioned ~ 100 IOPS "up to" 2,000 IOPS

Amazon SSD 9,000 – 120,000 IOPS

Capacity Planning, Asya Kamsky, 10gen

Storage Capability

Page 20: Capacity Planning

Intel X25-E (SLC) ~ 5,000 IOPS

Fusion IO ~ 135,000 IOPS

Violin Memory 6000 ~ 1,000,000 IOPS

Example IOPS 7,200 rpm SATA ~ 75-100 IOPS

15,000 rpm SAS ~ 175-210 IOPS

Amazon EBS/Provisioned ~ 100 IOPS "up to" 2,000 IOPS

Amazon SSD 9,000 – 120,000 IOPS

Capacity Planning, Asya Kamsky, 10gen

Storage Capability

Page 21: Capacity Planning

Intel X25-E (SLC) ~ 5,000 IOPS

Fusion IO ~ 135,000 IOPS

Violin Memory 6000 ~ 1,000,000 IOPS

Cost of IOPS 7,200 rpm SATA ~ 75-100 IOPS

15,000 rpm SAS ~ 175-210 IOPS

Amazon EBS/Provisioned ~ 100 IOPS "up to" 2,000 IOPS

Amazon SSD 9,000 – 120,000 IOPS

Capacity Planning, Asya Kamsky, 10gen

Storage Costs

Page 22: Capacity Planning

Storage

Capacity Planning, Asya Kamsky, 10gen

Measuring and Monitoring

Page 23: Capacity Planning

Storage

Capacity Planning, Asya Kamsky, 10gen

Measuring and Monitoring

Page 24: Capacity Planning

Storage

Capacity Planning, Asya Kamsky, 10gen

Measuring and Monitoring

Page 25: Capacity Planning

Memory

•  Working Set – Active Data in Memory – Measured Over Periods

Capacity Planning, Asya Kamsky, 10gen

Page 26: Capacity Planning

Memory

•  Work: – Sorting – Aggregation – Connections

Capacity Planning, Asya Kamsky, 10gen

SORTS

Connections

Aggregations

Page 27: Capacity Planning

Memory

•  New in 2.4 (just out) – workingSet option on db.serverStatus() db.serverStatus( { workingSet: 1 } )

Capacity Planning, Asya Kamsky, 10gen

Measuring and Monitoring

Page 28: Capacity Planning

Memory & Storage

Capacity Planning, Asya Kamsky, 10gen

> < ?

Page 29: Capacity Planning

Memory & Storage

Capacity Planning, Asya Kamsky, 10gen

MOPS: MongoDB Ops/sec

Page 30: Capacity Planning

Memory & Storage

Capacity Planning, Asya Kamsky, 10gen

MOPs

PFs

MOPS: MongoDB Ops/sec

Page 31: Capacity Planning

Memory & Storage

Capacity Planning, Asya Kamsky, 10gen

% Disk Util

MOPS

Page 32: Capacity Planning

CPU

•  Non-indexed Data

•  Sorting

•  Aggregation –  Map/Reduce –  Framework

•  Data –  Fields –  Nesting –  Arrays/Embedded-Docs

Capacity Planning, Asya Kamsky, 10gen

Page 33: Capacity Planning

CPU

Capacity Planning, Asya Kamsky, 10gen

MOPs

Page 34: Capacity Planning

CPU

Capacity Planning, Asya Kamsky, 10gen

MOPs

CPU %

Page 35: Capacity Planning

Memory & Storage

Capacity Planning, Asya Kamsky, 10gen

% Disk Util

MOPS

Page 36: Capacity Planning

Network

•  Latency –  WriteConcern –  ReadPreference –  Batching –  Documents (and Collections)

•  Throughput –  Update/Write Patterns –  Reads/Queries

Capacity Planning, Asya Kamsky, 10gen

Page 37: Capacity Planning

Starter Questions

•  What is the working set? –  How does that equate to memory –  How much disk access will that require

•  How efficient are the queries?

•  What is the rate of data change?

•  How big are the highs and lows?

Capacity Planning, Asya Kamsky, 10gen

Page 38: Capacity Planning

Deployment Types

All of these use the same resources:

•  Single Instance

•  Multiple Instances (Replica Set)

•  Cluster (Sharding)

•  Data Centers

Capacity Planning, Asya Kamsky, 10gen

Page 39: Capacity Planning

Capacity Planning: When?

Monitoring §  Storage

§ Memory

§ CPU

§ Network

§ Application Metrics

Capacity Planning, Asya Kamsky, 10gen

Page 40: Capacity Planning

Tools

•  MMS (MongoDB Monitoring Service)

•  MongoDB: mongotop, mongostat

•  Linux: iostat, vmstat, sar, etc

•  Windows: Perfmon

Measure realistic loads (generated by Load testing)

Capacity Planning, Asya Kamsky, 10gen

Page 41: Capacity Planning

Models

•  Load/Users –  Response Time/TTFB

•  System Performance –  Peak Usage –  Min/avg Usage

Capacity Planning, Asya Kamsky, 10gen

Page 42: Capacity Planning

Velocity of Change

•  Limitations -> takes time –  Data Movement –  Allocation/Provisioning (servers/mem/disk)

•  Improvement –  Limit Size of Change (if you can) –  Increase Frequency –  MEASURE its effect –  Practice

Capacity Planning, Asya Kamsky, 10gen

Page 43: Capacity Planning

Repeat (continuously)

•  Repeat Testing

•  Repeat Evaluations

•  Repeat Deployment

Capacity Planning, Asya Kamsky, 10gen

Page 44: Capacity Planning

What if I skip capacity planning?

You will be featured ...

Capacity Planning: What If...

Capacity Planning, Asya Kamsky, 10gen

Page 45: Capacity Planning

Senior Solutions Architect, 10gen

Asya Kamsky

#MongoDBDays

Thank You