getting started with aws compute services

104
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sr. Product Marketing Manager Compute Services, AWS May 2016 Getting Started with AWS Compute Services Aaron Kao

Upload: amazon-web-services

Post on 13-Jan-2017

313 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Getting Started with AWS Compute Services

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

Sr. Product Marketing Manager

Compute Services, AWS

May 2016

Getting Started with

AWS Compute Services

Aaron Kao

Page 2: Getting Started with AWS Compute Services

Agenda

Compute Overview

What is Amazon EC2

Applications Evolved

Compute Evolved

How to Choose

Page 3: Getting Started with AWS Compute Services

Compute Overview

Page 4: Getting Started with AWS Compute Services

AWS Compute Offerings

• VMs

• Machine as the unit of scale

• Abstracts the hardware

• Containers

• Application as the unit of scale

• Abstracts the OS

• Serverless

• Functions as the unit of scale

• Abstracts the language runtime

ECS

EC2

Lambda

Page 5: Getting Started with AWS Compute Services

What is Amazon EC2?

Page 6: Getting Started with AWS Compute Services

Amazon EC2 – Overview

Virtual Servers in the Cloud

Server

Hypervisor

VM 1 VM 2 VM 3

Physical Servers in AWS Global Regions

Page 7: Getting Started with AWS Compute Services

Over 1 million active customers across 190 countries

2,000 government agencies

5,000 educational institutions

17,500 nonprofits

12 regions

33 Availability Zones

*11 more Availability Zonesand 5 more Regions coming online throughout the year

AWS Global Infrastructure

Page 8: Getting Started with AWS Compute Services

Amazon EC2 – Nine Years Ago…

First generation, single instance family and size

• m1.small (1 vCPU, 1.7 GiB RAM, 160 GB storage)

Linux only

On-Demand pricing only

Page 9: Getting Started with AWS Compute Services

Amazon EC2 – Today

General-purpose: M1, M3 , T2, M4

Compute-optimized: C1, CC2, C3, C4

Memory-optimized: M2, CR1, R3 {X1}

Dense-storage: HS1, D2

I/O-optimized: HI1, I2

GPU: CG1, G2

Micro: T1, T2

# of

instances

Page 10: Getting Started with AWS Compute Services

EC2 Instances: Types and Sizes

c4.largeInstance family

Instance generation

Instance size

Page 11: Getting Started with AWS Compute Services

http://aws.amazon.com/ec2/instance-types/

EC2 Instances: Types and Sizes

Page 12: Getting Started with AWS Compute Services

1 2 4 8 16 321

2

4

8

16

32

64

128

256

Me

mo

ry (

GB

)

vCPU

g2.2xlarge8 vCPU, 15 GB1 x 60 SSDNVIDIA GPU (1,536 CUDA cores, 4GB Mem)

4 vCPU, 30.5 GBi2.xlarge (High IO) - 1 x 800 SSDd2.xlarge (Dense) - 3 x 2000 HDD

8 vCPU, 61 GBi2.xlarge (High IO) - 2 x 800 SSDd2.xlarge (Dense) - 6 x 2000 HDD

16 vCPU, 122 GBi2.xlarge (High IO) - 4 x 800 SSDd2.xlarge (Dense) - 12 x 2000 HDD

32 vCPU, 244 GBi2.xlarge (High IO) - 8 x 800 SSD

36 vCPU, 244 GBd2.xlarge (Dense) - 24 x 2000 HDD

m3.xlarge4 vCPU, 15 GB2 x 40 SSD

m3.2xlarge8 vCPU, 30 GB2 x 80 SSD

m3.large2 vCPU, 7.5 GB1 x 32 SSDm3.medium

1 vCPU, 3.75 GB, 1 x 4 SSD

t2.micro1 vCPU, 1GBEBS Only

t2.small1 vCPU, 2GBEBS Only

t2.medium2 vCPU, 4GBEBS Only

r3.large2 vCPU, 15.25 GB1 x 32 SSD

r3.xlarge4 vCPU, 30.5 GB1 x 80 SSD

r3.2xlarge8 vCPU, 61 GB1 x 160 SSD

r3.4xlarge16 vCPU, 122 GB1 x 320 SSD

r3.8xlarge32 vCPU, 244 GB2 x 320 SSD

2 vCPU, 3.75 GBc4.large - EBS Onlyc3.large - 2 x 16 SSD

4 vCPU, 7.5 GBc4.xlarge - EBS Onlyc3.xlarge - 2 x 40 SSD

8 vCPU, 15 GBc4.2xlarge - EBS Onlyc3.2xlarge - 2 x 80 SSD

16 vCPU, 30 GBc4.4xlarge - EBS Onlyc3.4xlarge - 2 x 160 SSD

32 vCPU, 60 GBc4.8xlarge - EBS Onlyc3.8xlarge - 2 x 320 SSD

m4.large2 vCPU, 8 GBEBS Only

m4.xlarge4 vCPU, 16 GBEBS Only

m4.2xlarge8 vCPU, 32 GBEBS Only

m4.4xlarge16 vCPU, 64 GBEBS Only

m4.10xlarge40 vCPU, 160GBEBS Only

m4.large2 vCPU, 8 GBEBS Only

Storage Optimized

GPU Instances

General Purpose

Memory Optimized

Compute Optimized

New M4’s/T2 Large

t2.nano1 vCPU, 512MBEBS Only

EC2 Instances: Types and Sizes

Page 13: Getting Started with AWS Compute Services

Locally attached or “instance storage”

Network attached:

Amazon EBS General Purpose (SSD) volumes

Amazon EBS Provisioned IOPS (SSD) volumes

Amazon EBS Magnetic volumes

Amazon EFS

Amazon S3 and Amazon Glacier for object storage

Storage Options

Page 14: Getting Started with AWS Compute Services

Elastic cloud-based resources

Actual demand

Resources scaled to demand

Waste Customer

dissatisfaction

Actual demand

Predicted demand

Rigid on-premises resources

Auto Scaling

Page 15: Getting Started with AWS Compute Services

On-Demand

Pay for compute

capacity by the

hour with no long-

term commitments

For spiky

workloads, or to

define needs

Reserved

Make a low, one-

time payment and

receive a

significant discount

on the hourly

charge

For committed

utilization

Spot

Bid for unused

capacity, charged at

a Spot Price which

fluctuates based on

supply and demand

For time-insensitive

or transient

workloads

Dedicated

Launch instances

within Amazon VPC

that run on hardware

dedicated to a single

customer

For highly sensitive

or compliance-related

workloads

Purchasing Options

Page 16: Getting Started with AWS Compute Services

Fast DeploymentsAccess computing

infrastructure in minutes

Low CostPay-as-you-go pricing

ElasticEasily add or remove capacity

Globally AccessibleEasily support customers

around the world

SecureA collection of tools to

protect data and privacy

ScalableAccess to effectively

limitless capacity

Benefits of Cloud Servers

Page 17: Getting Started with AWS Compute Services

Applications Evolved

Page 18: Getting Started with AWS Compute Services

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

Data

Access

A Monolithic Architecture

Page 19: Getting Started with AWS Compute Services

Scaling a Monolithic Architecture

Page 20: Getting Started with AWS Compute Services

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

A Microservices Architecture

Page 21: Getting Started with AWS Compute Services

Order UI User UI UI

Order

ServiceService

Shipping

Service

Order UIOrder UI

User UI UIShipping

UI

Order

ServiceOrder

Service

ServiceService

ServiceService

User

Service

Shipping

Service

Scaling a Microservices Architecture

Page 22: Getting Started with AWS Compute Services

Compute Evolved – Containers

Page 23: Getting Started with AWS Compute Services

Docker

Page 24: Getting Started with AWS Compute Services

What are Containers?

OS virtualization

Process isolation

Images

Automation Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 25: Getting Started with AWS Compute Services

Container Advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 26: Getting Started with AWS Compute Services

Containers are Natural for Microservices

Simple to model

Any app, any language

Image is the version

Test & deploy same artifact

Stateless servers decrease change risk

Page 27: Getting Started with AWS Compute Services

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Managing One Host is Straightforward

Page 28: Getting Started with AWS Compute Services

Managing a Fleet is Hard

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

AZ 1 AZ 2

AZ 3

Page 29: Getting Started with AWS Compute Services

What is Amazon ECS?

Amazon EC2 Container Service (Amazon ECS) is a highly

scalable, high performance container management

service.

You can use Amazon ECS to schedule the placement of

containers across your cluster.

You can also integrate your own scheduler or third-party

scheduler to meet business or application specific

requirements.

Page 30: Getting Started with AWS Compute Services

Container Management at Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 31: Getting Started with AWS Compute Services

Flexible Container Placement

Long running applications

Batch jobs

Multiple schedulers

Page 32: Getting Started with AWS Compute Services

Integration with the AWS Platform

Elastic Load Balancing

Amazon Elastic Block Store

Amazon Virtual Private Cloud

Amazon CloudWatch

AWS Identity and Access Management

AWS CloudTrail

Page 33: Getting Started with AWS Compute Services

Compute Evolved – Serverless

Page 34: Getting Started with AWS Compute Services

What is Serverless?

Operations and Management

Provisioning and Utilization

Scaling

Availability and Fault Tolerance

Page 35: Getting Started with AWS Compute Services

Benefits of Serverless

Simple

Scalable

Low Cost

Reliable

Low Latency

Page 36: Getting Started with AWS Compute Services

What is AWS Lambda?

AWS Lambda lets you run code without provisioning or

managing servers.

You pay only for the compute time you consume - there is

no charge when your code is not running.

Just upload your code and Lambda takes care of

everything required to run and scale your code with high

availability

Page 37: Getting Started with AWS Compute Services

Using AWS Lambda

Bring your own code

• Node.js, Java, Python

• Bring your own libraries

(even native ones)

Simple resource model

• Select power rating from

128 MB to 1.5 GB

• CPU and network allocated

proportionately

• Reports actual usage

Flexible authorization

• Securely grant access to

resources, including VPCs

• Fine-grained control over

who can call your functions

Flexible use

• Call or send events

• Integrated with other AWS

services

• Build whole serverless

ecosystems

Page 38: Getting Started with AWS Compute Services

Using AWS Lambda

Programming model

• AWS SDK built in (Python

and Node.js)

• Eclipse plugin (Java)

• Lambda is the “webserver”

• Use processes, threads,

/tmp, sockets normally

Stateless

• Persist data using Amazon

DynamoDB, S3, or

ElastiCache

• No affinity to infrastructure

(can’t “log in to the box”)

Authoring functions

• Author directly using the

console WYSIWYG editor

• Package code as a .zip and

upload to Lambda or S3

• Plugins for Eclipse and

Visual Studio

• Command line tools

Monitoring and logging

• Built-in metrics for requests,

errors, latency, and throttles

• Built-in logs in Amazon

CloudWatch Logs

Page 39: Getting Started with AWS Compute Services

Pay-per Request

• Buy compute time in

100 ms increments for

21 microcents

• Request charge of 20

microcents

• No hourly, daily, or

monthly minimums

• No per-device fees

Free Tier

1 million requests and 400,000 GBs of compute

every month, every customer

Page 40: Getting Started with AWS Compute Services

How to Choose

Page 41: Getting Started with AWS Compute Services

How Do I Choose?

• VMs

• “I want to configure machines,

storage, networking, and my OS”

• Containers

• “I want to run servers, configure

applications, and control scaling”

• Serverless

• “Run my code when it’s needed”

ECS

EC2

Lambda

Page 42: Getting Started with AWS Compute Services

If You Need to Run…

• Open-source cluster management, big data, and

database software (e.g., Mesos, Hadoop)

• Enterprise applications (e.g., SAP, Oracle, Sharepoint)

• On-premises migrations

EC2

Page 43: Getting Started with AWS Compute Services

If You Need to Run…

• Web applications

• Docker workloads

• Microservices

• Batch jobs

ECS

Page 44: Getting Started with AWS Compute Services

If You Need to Run…

Web applications

Mobile backends

IoT backends

Stream processing workloads

File processing workloads

Lambda

Page 45: Getting Started with AWS Compute Services

Thank you!

Page 46: Getting Started with AWS Compute Services

Appendix

Page 47: Getting Started with AWS Compute Services

How ECS Helps

Page 48: Getting Started with AWS Compute Services

What is Amazon ECS?

Amazon EC2 Container Service (Amazon ECS) is a highly

scalable, high performance container management

service.

You can use Amazon ECS to schedule the placement of

containers across your cluster.

You can also integrate your own scheduler or third-party

scheduler to meet business or application specific

requirements.

Page 49: Getting Started with AWS Compute Services

Container Management at Any Scale

Nothing to run

Complete state

Control and monitoring

Scale

Page 50: Getting Started with AWS Compute Services

Flexible Container Placement

Long running applications

Batch jobs

Multiple schedulers

Page 51: Getting Started with AWS Compute Services

Integration with the AWS Platform

Elastic Load Balancing

Amazon Elastic Block Store

Amazon Virtual Private Cloud

Amazon CloudWatch

AWS Identity and Access Management

AWS CloudTrail

Page 52: Getting Started with AWS Compute Services

Container Management

Page 53: Getting Started with AWS Compute Services

What is a Container Manager?

• Maintains available resources

• Tracks resource changes

• Accepts resource requests

• Guarantees accuracy and consistency

Page 54: Getting Started with AWS Compute Services

CPU

Memory

Ports

Disk space

Disk IOPS

Network bandwidth

Resources

Page 55: Getting Started with AWS Compute Services

ECS

Agent

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

https://github.com/aws/amazon-ecs-agent

Page 56: Getting Started with AWS Compute Services

Instance Registration

register-container-instance --total-resources

[{

“name” : “cpu”,“type” : “integerValue”,“integerValue” : 2048

},…

]

Page 57: Getting Started with AWS Compute Services

Modifying Exposed Resources

Page 58: Getting Started with AWS Compute Services

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

Data

Access

A Monolithic Architecture

Page 59: Getting Started with AWS Compute Services

Scaling a Monolithic Architecture

Page 60: Getting Started with AWS Compute Services

Order UI User UIShipping

UI

Order

Service

User

Service

Shipping

Service

A Microservices Architecture

Page 61: Getting Started with AWS Compute Services

Order UI User UI UI

Order

ServiceService

Shipping

Service

Order UIOrder UI

User UI UIShipping

UI

Order

ServiceOrder

Service

ServiceService

ServiceService

User

Service

Shipping

Service

Scaling a Microservices Architecture

Page 62: Getting Started with AWS Compute Services

Docker

Page 63: Getting Started with AWS Compute Services

Container Advantages

Portable

Flexible

Fast

EfficientServer

Guest OS

Bins/Libs Bins/Libs

App2App1

Page 64: Getting Started with AWS Compute Services

Containers are Natural for Microservices

Simple to model

Any app, any language

Image is the version

Test & deploy same artifact

Stateless servers decrease change risk

Page 65: Getting Started with AWS Compute Services

Server

Guest OS

Bins/Libs Bins/Libs

App2App1

Managing One Host is Straightforward

Page 66: Getting Started with AWS Compute Services

Managing a Fleet is Hard

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

Server

Guest OS

AZ 1 AZ 2

AZ 3

Page 67: Getting Started with AWS Compute Services

What Are Microservices Challenges?

Resource and state management

Data management

Monitoring

Service discovery

Deployment

Page 68: Getting Started with AWS Compute Services

How do you model your

applications?

Page 69: Getting Started with AWS Compute Services
Page 70: Getting Started with AWS Compute Services

{

"environment": [],

"name": "simple-demo",

"image": "my-demo",

"cpu": 10,

"memory": 500,

"portMappings": [

{

"containerPort": 80,

"hostPort": 80

}

],

"mountPoints": [

{

"sourceVolume": "my-vol",

"containerPath": "/var/www/my-vol"

}

],

"entryPoint": [

"/usr/sbin/apache2",

"-D",

"FOREGROUND"

],

"essential": true

},

Page 71: Getting Started with AWS Compute Services

Tasks

Shared Data Volume

Containers

launchContainer

Instance

Volume Definitions

Container Definitions

Page 72: Getting Started with AWS Compute Services

Starting a Task

API

User /

Scheduler

StartTask

Page 73: Getting Started with AWS Compute Services

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Page 74: Getting Started with AWS Compute Services

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Page 75: Getting Started with AWS Compute Services

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Container Instance

ECS Agent

Task

Container

WebSocket

Page 76: Getting Started with AWS Compute Services

Starting a Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

SubmitStateChange

Page 77: Getting Started with AWS Compute Services

Tracking Resource Changes

Page 78: Getting Started with AWS Compute Services

Terminated Task

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Docker

Task

Container Instance

Container

ECS Agent

SubmitStateChange

Page 79: Getting Started with AWS Compute Services

Missing Container Instance

API

User /

Scheduler

StartTask

Cluster Management Engine

Docker

Task

Container Instance

Container

ECS Agent

?

Agent Communication

Page 80: Getting Started with AWS Compute Services

Terminated Container Instance

API

User /

Scheduler

StartTask

Cluster Management Engine

Agent Communication

Termination

Notifier

Docker

Task

Container Instance

Container

ECS Agent

Page 81: Getting Started with AWS Compute Services

Guaranteeing Accuracy and Consistency

Page 82: Getting Started with AWS Compute Services

Amazon ECS Under the Hood

IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5

IDN+6

IDN+5

WRITE

READ

Page 83: Getting Started with AWS Compute Services

Amazon ECS Under the Hood

IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5

IDN+6IDN+3

IDN+5IDN+2

WRITE WRITE

READREAD

Page 84: Getting Started with AWS Compute Services

Scalable

Page 85: Getting Started with AWS Compute Services

Schedulers

Page 86: Getting Started with AWS Compute Services

What is a Scheduler?

• Determine desired state

• Check against current state

• Perform action

Page 87: Getting Started with AWS Compute Services

Amazon ECS Service Scheduler

Page 88: Getting Started with AWS Compute Services

What is a Service?

• Models a long-running application

• Maintains desired state

• Optionally runs behind an Elastic Load Balancing load

balancer

Page 89: Getting Started with AWS Compute Services

Discovering DifferencesDeployment Status Desired Pending Running

ecs-svc/1 PRIMARY 5 0 0

Minimum Healthy Maximum Healthy

50% 200%

Page 90: Getting Started with AWS Compute Services
Page 91: Getting Started with AWS Compute Services

Discovering DifferencesDeployment Status Desired Pending Running

ecs-svc/2 PRIMARY 10 0 0

ecs-svc/1 ACTIVE 5 0 5

Minimum Healthy Maximum Healthy

50% 200%

Page 92: Getting Started with AWS Compute Services
Page 93: Getting Started with AWS Compute Services

Other Considerations

• ELB registration/deregistration

• Permissions and errors

• Task health

• Scale down requests

Page 94: Getting Started with AWS Compute Services
Page 95: Getting Started with AWS Compute Services

Multiple Schedulers

Page 96: Getting Started with AWS Compute Services

Amazon ECS: Scheduling

Page 97: Getting Started with AWS Compute Services

Amazon ECS: Scheduling

Page 98: Getting Started with AWS Compute Services

Amazon ECS: Scheduling

Page 99: Getting Started with AWS Compute Services

Amazon ECS: Scheduling

Page 100: Getting Started with AWS Compute Services

To recap

Page 101: Getting Started with AWS Compute Services
Page 102: Getting Started with AWS Compute Services

{

"environment": [],

"name": "simple-demo",

"image": "my-demo",

"cpu": 10,

"memory": 500,

"portMappings": [

{

"containerPort": 80,

"hostPort": 80

}

],

"mountPoints": [

{

"sourceVolume": "my-vol",

"containerPath": "/var/www/my-vol"

}

],

"entryPoint": [

"/usr/sbin/apache2",

"-D",

"FOREGROUND"

],

"essential": true

},

“Task Definitions”

Page 103: Getting Started with AWS Compute Services

Docker

Task

Container Instance

Amazon

ECS

Container

ECS Agent

ELB

Internet

ELB

User / Scheduler

API

Cluster Management Engine

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

Docker

Task

Container Instance

Container

ECS Agent

Task

Container

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

Page 104: Getting Started with AWS Compute Services