aws webcast - cost and performance optimization in amazon rds

40
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Greg Khairallah, Business Development Manager for Big Data and Analytics, AWS March 19, 2015 Cost and Performance Optimization in Amazon RDS

Upload: amazon-web-services

Post on 18-Jul-2015

1.534 views

Category:

Technology


10 download

TRANSCRIPT

© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Greg Khairallah, Business Development Manager

for Big Data and Analytics, AWS

March 19, 2015

Cost and Performance

Optimization in Amazon RDS

Agenda

Instance and Storage Selection

Monitoring

Reserved Instances

Instance and Storage Selection

Instance Selection

• RDS offers a wide range of instance classes

• Instance types differ on CPU, RAM, network performance, EBS Optimized

• Base selection on• Performance

• Cost (will differ based on type and region)

• Region (not all instance types available in all regions)

• Engine (not all instance types available for all engines)

• Elastically scale instance size up/down

Instance Selection: Current GenerationInstance Type vCPU Memory (GiB)

PIOPS-OptimizedNetwork Performance

Standard - Current Generation

db.m3.medium 1 3.75 - Moderate

db.m3.large 2 7.5 - Moderate

db.m3.xlarge 4 15 Yes Moderate

db.m3.2xlarge 8 30 Yes High

Memory optimized - current generation

db.r3.large 2 15 - Moderate

db.r3.xlarge 4 30.5 Yes Moderate

db.r3.2xlarge 8 61 Yes High

db.r3.4xlarge 16 122 Yes High

db.r3.8xlarge 32 244 - 10 Gigabit

Micro instances

db.t2.micro 1 1 - Low to Moderate

db.t2.small 1 2 - Low to Moderate

db.t2.medium 2 4 - Low to Moderate

Instance Selection: Previous Generation

Instance Type vCPU Memory (GiB) PIOPS-OptimizedNetwork

Performance

Standard - previous generation

db.m1.small 1 1.7 - Low

db.m1.medium 1 3.75 - Moderate

db.m1.large 2 7.5 Yes Moderate

db.m1.xlarge 4 15 Yes High

Memory optimized - previous generation

db.m2.xlarge 2 17.1 - Moderate

db.m2.2xlarge 4 34.2 Yes Moderate

db.m2.4xlarge 8 68.4 Yes High

db.cr1.8xlarge 32 244 - High

Micro instances

db.t1.micro 1 0.613 - Very Low

Instance Selection

• Measure existing application workload

• Use native database engine tools – system tables, Oracle

Enterprise Manager, Statspack, SQL Server Tuning Advisor

• Use CloudWatch metrics

• Test and scale accordingly

What is General Purpose (SSD) Storage

• New EBS Volume Type - SSD Backed / Solid State Drive

• New Default Volume Type on RDS

• Available on all RDS DB Instance types and DB engines in all

Regions

• Flat, Per-Gigabyte Rate. No I/O Charges

• Volume bundles Baseline IOPS

• 1GB : 3 IOPS.

• Scales predictably, linearly, 10:30 ,100:300, 1TB:3K

• Burst Capable Volume

Sizing General Purpose (SSD) volume for

databases• Calculate your required IOPS needed in steady state

• Provision the GB = (Steady state IOPS) ÷ 3

• For example, customer requiring1500 steady state IOPS

• Provision 1500 ÷ 3 = 500 GB

• IO bursts will support

• Database load or table scan operations

• Spike in IO workload

Provisioned IOPS

• Provisioned IOPS storage is a storage option that delivers fast, predictable, and consistent throughput performance

• When fast and consistent I/O performance required

• Optimized for I/O intensive, online transaction processing (OLTP) workloads that have consistent performance requirements

• Important: Recommended for random reads and writes and not sequential workloads

Activities that Impact Storage Performance

• Nightly backups

• There is no additional charge for backup storage up to 100% of your provisioned database storage for an active DB Instance

• Perform these tasks during your maintenance window• DB snapshot creation

• Single-AZ to Multi-AZ modification

• Read replica creation

Caveats

• Allocated storage and provisioned storage can be modified

• Scaling Storage operations can impact performance until new

allocation is finished

• Except for SQL Server

• Export data

• Create new DB instance with larger storage

• Import data

• Initially size SQL Server storage for future growth to avoid this

Burst mode – GP2 & T2

GP2 – SSD based Amazon EBS storage

• 3 IOPS per GB base performance

• Earn credits when usage below base

• Burst to 3000+ IOPS

T2 – Amazon EC2 instance with burst capability

• Base performance + burst

• Earn credits per hour when below base performance

• Can store up to 24 hours worth of credits

• Amazon CloudWatch metrics to see credits & usage

Burst mode – GP2 & T2

T2 – CPU credits

Burst mode vs. Standard vs. Provisioned IOPS

0

1000

2000

3000

4000

5000

6000

7000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tra

ns

ac

tio

ns

pe

r S

ec

on

d (

TP

S)

Hours

100% Read - 20GB data

Series1

$0.575 per hour

Burst mode vs. Standard vs. Provisioned IOPS

0

1000

2000

3000

4000

5000

6000

7000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tra

ns

ac

tio

ns

pe

r S

ec

on

d (

TP

S)

Hours

100% Read - 20GB data

Series1 Series2

$0.575 per hour

$0.408 per hour

Burst mode vs. Standard vs. Provisioned IOPS

0

1000

2000

3000

4000

5000

6000

7000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tra

ns

ac

tio

ns

pe

r S

ec

on

d (

TP

S)

Hours

100% Read - 20GB data

Series1 Series2 Series3

$0.575 per hour

$0.408 per hour

$0.508 per hour

Burst mode vs. Standard vs. Provisioned IOPS

0

1000

2000

3000

4000

5000

6000

7000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tra

ns

ac

tio

ns

pe

r S

ec

on

d (

TP

S)

Hours

100% Read - 20GB data

Series1 Series2 Series3 Series4

$0.105 per hour

$0.575 per hour

$0.408 per hour

$0.508 per hour

Burst mode vs. Standard vs. Provisioned IOPS

0

1000

2000

3000

4000

5000

6000

7000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tra

ns

ac

tio

ns

pe

r S

ec

on

d (

TP

S)

Hours

100% Read - 20GB data

Series1 Series2 Series3 Series4 Series5

$0.105 per hour

$0.575 per hour

$0.233 per hour

$0.408 per hour

$0.508 per hour

Scale and Performance

How to scale with Amazon RDS

• Scale up or down with resizable instance types• CPU to 32 vCPUs, RAM to 244 GiB

• Scale your storage up with a few clicks• Scale while online

• Easy conversion from standard to Provisioned IOPS storage

• Put a cache in front of Amazon RDS• Amazon ElastiCache for Memcached or Redis

• Or your favorite cache, self-managed in Amazon EC2

• Offload read traffic to Read Replicas

Reads10% Reads10% Reads10% Reads10%Reads10% Reads10% Reads10% Reads10%

Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%

Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%Reads10%Writes10%

Reads10%

Reads10%Writes10%Reads10%Writes10%Reads10%

Reads

90%

Writes10%

Read to write ratio

Primary

Writes10%

Replica1

Writes10%

Replica2

Writes10%

Replica3

Writes10%

Replica4

Writes 20% Writes 20% Writes 20% Writes 20%

Reads

80%

Reads 20% Reads 20% Reads 20% Reads 20%

Reads 20%

Writes 20%

Reads 20%

Writes 20%

Reads 20%

Writes 20%

Reads 20%

Writes 20%

Writes 20%

Writes20%

Read to write ratio – More writes

Primary Replica1 Replica2 Replica3 Replica4

Series1

Series2

Series3

Series4

Series5

1

2

3

4

5

6

7

8

1 2 3 4 5 6

Scale

Scale based on % Write

InnoDB cache warming

4x

Load buffer pool

Dump buffer pool

0

5000

10000

15000

20000

25000

30000

1 3 5 7 9

11

13

15

17

19

21

23

25

27

29

31

33

35

37

39

41

43

45

47

49

51

53

55

57

59

61

63

65

67

69

Tra

nsa

cti

on

s p

er

Se

co

nd

Time (sec)

Workload with 50/50 R/W ratio

Unwarmed Cache

Warmed Cache4X

9 min

To enable InnoDB cache warming…

Monitoring

CloudWatch

• Monitor AWS resources in real-time

• Collect and track metrics

• Metrics data provide visibility into performance, storage, number of database connections, etc.

• Send notifications based on the monitoring rules that you define

CloudWatch Alert Options

• RDS Metrics

• CPU Utilization - Track the percentage of CPU utilization

• Free Storage Space – Track available storage space

• Free Memory – Amount of Available RAM

• Database Connections – Number of databases connections in use

CloudWatch Alert Options

• RDS Metrics

• IOPS – Number of IO operations completed per second

• Latency – Elapsed time between the submission of an I/O and it’s submission.

• Throughput – Number of bytes per second transferred to or from disk

• Queue Depth – Number of I/O requests in the queue waiting to be serviced

CloudWatch Alert Options

• Queue Depth – Number of I/O requests in the queue waiting

to be serviced

• Queue depth of 5 for every 1000 IOPS

• If less, not enough I/O generated

• If more, you may want to increase IOPS

CloudWatch Alert Options

Metric Actions

CPU Utilization Scale Compute

Freeable Space Scale Storage Up

Freeable Memory and Swap Usage Scale Compute

Write Latency Add Provisioned IOPS

DB Connections Check connection pooling

CloudWatch Alert Options

Cloudwatch Alert Options

• A number of options to get alerted – SMS, SQS, HTTPS,

Email-JSON, Email………

Database Parameter Groups

DB parameter groups act as a container for engine configuration values

that are applied to one or more DB instances.

Reduce Costs

Save money with RDS Reserved Instances

Pay a low up-front fee to get a lower hourly price on

database instances for a 1- or 3-year term

The lower-price entitlement applies to any running instance

matching its description

Choose among Heavy, Medium, Light RIs

Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Month 7 Month 8 Month 9 Month 10 Month 11 Month 12

On-demand 544.50 1,089.00 1,633.50 2,178.00 2,722.50 3,267.00 3,811.50 4,356.00 4,900.50 5,445.00 5,989.50 6,534.00

Heavy RI 1-yr 1,508.10 1,750.20 1,992.30 2,234.40 2,476.50 2,718.60 2,960.70 3,202.80 3,444.90 3,687.00 3,929.10 4,171.20

Start saving here

Thank You!