0% found this document useful (0 votes)
92 views67 pages

ArchitectingOnAWS Module 03 Compute Layer

The document discusses adding compute resources using Amazon EC2. It describes launching EC2 instances from AMIs, which include templates and permissions that allow instances to be configured in a repeatable, reusable, and recoverable way. User data can be passed to instances at launch to customize configurations. Instance metadata is available within each EC2 instance to retrieve information about itself.

Uploaded by

Arvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views67 pages

ArchitectingOnAWS Module 03 Compute Layer

The document discusses adding compute resources using Amazon EC2. It describes launching EC2 instances from AMIs, which include templates and permissions that allow instances to be configured in a repeatable, reusable, and recoverable way. User data can be passed to instances at launch to customize configurations. Instance metadata is available within each EC2 instance to retrieve information about itself.

Uploaded by

Arvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 67

Adding a Compute Layer

Module 3
Adding the Compute Layer
Region

Amazon EC2 Amazon RDS Amazon


NAT Gateway Instance Memcached Standby Replica EFS Mount

Availability Zone
Target
Amazon
CloudFront

Internet App Subnet


Public Subnet Data Subnet
Gateway

Application
Load Balancer Auto Scaling

Amazon
Amazon
Route 53
EFS
Public Subnet App Subnet Data Subnet

Availability Zone
Static Amazon EC2 Amazon
Amazon
NAT Gateway Memcached
Assets Instance RDS Primary EFS Mount
Target
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 3

The architectural need

You need to run applications that are going to be used by a consistent, but small number
of users.

Module Overview

• Amazon Elastic Compute Cloud (Amazon EC2)


• Instance types and families
• Amazon Elastic Block Store (Amazon EBS) volumes
• Compliance options

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Adding Compute with Amazon EC2

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Needs Can Amazon EC2 Address?

Web hosting

Databases

Authentication
Amazon
EC2
Anything a server can do

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Virtual Machines vs. Physical Servers

Amazon EC2 can solve some problems that are more difficult
with an on-premises server.

When using disposable resources

Data-driven Quick iterations Free to make


decisions mistakes

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Launching Amazon EC2 Instances with
Amazon Machine Images (AMIs)

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 and AMIs
Amazon EC2 Service

Your AMI

EC2 instances

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 and AMIs
Amazon EC2 Service

AMIs include:
One or more EBS volumes

A template for the root volume

Launch permissions
Your AMI
A block device mapping 

EC2 instances

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Where Do You Get an AMI?

Three ways to get your AM


I

Pre-Built AWS Marketplace Create your own

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Do AMIs Help?

Repeatability

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Do AMIs Help?

Repeatability

Reusability

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Do AMIs Help?

Repeatability

Reusability

Recoverability

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Do AMIs Help?

Repeatability

Reusability

Recoverability

Marketplace Solutions

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How Do AMIs Help?

Repeatability

Reusability

Recoverability

Marketplace Solutions

Backups
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Image Builder

EC2 Image Builder simplifies the creation, maintenance, validation, sharing, and
deployment of Linux or Windows Server images.

Source image EC2 Image Customize software Source image with Test images Distribute golden
Builder installed on the AWS provided or images
image custom templates

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Launching Amazon EC2 Instances with
User Data

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Launching EC2 Instances with User Data

User Data

#!/bin/bash
yum update –y
service httpd start

Your AMI chkconfig httpd on Running EC2


Instance

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Retrieving Information about Your EC2 Instance with Instance
Metadata

User Data
#!/bin/bash
yum update –y
hostname = $(curl -s
http://169.254.169.254/latest/meta-data/public-

Your AMI hostname)


Running EC2
Instance

Metadata Value
instance-id i-1234567890abcdef0
mac 00-1B-63-84-45-E6
public-hostname ec2-203-0-113-25.compute-1.amazonaws.com
public-ipv4 67.202.51.223
local-hostname ip-10-251-50-12.ec2.internal
local-ipv4 10.251.50.12

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 and Storing Data

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Problems Does Amazon Elastic Block Store (Amazon EBS)
Solve?

EC2
Application needs Instance store is
block-level storage ephemeral

Need data to persist Need to be able to back


through shutdowns up data volumes

Keep in mind: Multiple volumes of Amazon EBS can be on the same instance, but each
volume can be attached to only one instance at a time.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EBS Volume Types

Solid-State Backed

Volume Type General Purpose SSD Provisioned IOPS SSD

Description General purpose SSD volume that balances Highest-performance SSD volume for mission-
price and performance for a wide variety of critical low-latency or high-throughput
workloads workloads

Use Cases • Recommended for most workloads • Critical business applications that require
sustained IOPS performance

• Large database workloads

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EBS Volume Types
Hard-Disk Backed

Volume Type Throughput Optimized HDD Cold HDD

Description Low cost HDD volume designed for Lowest cost HDD volume designed for less
frequently accessed, throughput-intensive frequently accessed workloads
workloads
Use Cases • Streaming workloads • Throughput-oriented storage for large
volumes of data that is infrequently
• Big data accessed

• Data warehouses • Scenarios where the lowest storage cost is


important
• Log processing
• Cannot be a boot volume
• Cannot be a boot volume

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Instances Optimized for Amazon EBS

• Optimized configuration stack

• Additional dedicated capacity for Amazon EBS I/O

• Minimizes contention between Amazon EBS and other traffic


EBS Optimized
Instance
• Options between 425 Mbps and 14,000 Mbps

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Shared File Systems

What if I have multiple instances that need to use the same storage?

EBS S3 EFS/FSx

Amazon EBS Amazon S3 is Amazon EFS and


only attaches to an option but is Amazon FSx are
one instance not ideal perfect for this task
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Elastic File System (EFS)

Availability Zone

Amazon EFS Subnet


(Linux Workloads) EC2 Instance EC2 Instance

NFSv4 protocol
Availability Zone Availability Zone

Subnet Subnet

EC2 Instance EC2 Instance EC2 Instance EC2 Instance

Shared Across
Mount Target
• Availability Zones Mount Target
Mount Target Mount Target
Mount Target

• Regions
• VPCs
• Account

Amazon EFS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Instance Types

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Instances – What’s in a Name?

m5.large
Examples

m is the family name


t2.large

5 Is the generation number


c5.xlarge

large is the size of the instance


p3.2xlarge

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Instances – Sizes

Model vCPU Scaling Vertically

m5.large 2

m5.xlarge 4

m5.2xlarge 8

m5.4xlarge 16

m5.12xlarge 48

m
m5.24xlarge 96

m
5.
5.

5.
xl
la

2x
ar
rg

la
ge
e

rg
e
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Instances – Types

Choosing the correct type is very important for:

Efficient utilization of Reducing unneeded


your instances cost

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Instances – Types

General Purpose A1, T3, T3a, T2, M6g, M5, M5a, M5n, M4

Compute Optimized C5, C5n, C4

Memory Optimized R5, R5a, R5n, R4, X1e, X1, High Mem., z1d

Accelerated Computing P3, P2, Inf1, G4, G3, F1

Storage Optimized I3, I3en, D2, H1

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 – General Purpose Example

Baseline
Model vCPU CPU Credits / Hour Mem (GiB)  Storage
Performance/vCPU
2 6
t3.nano 5% 0.5 EBS-Only

2 12 EBS-Only
t3.micro 10% 1

2 24 EBS-Only
t3.small 20% 2

Good for burstable workloads like


24 EBS-Only
website and web applications t3.medium 2 20% 4

36
t3.large 2 30% 8 EBS-Only

96
t3.xlarge 4 40% 16 EBS-Only

192
t3.2xlarge 8 40% 32 EBS-Only

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 – Compute Optimized Example

Model vCPU Mem (GiB) Storage EBS Bandwidth (Mbps)

c5.large 2 4 EBS-Only Up to 2,250

c5.xlarge 4 8 EBS-Only Up to 2,250

c5.2xlarge 8 16 EBS-Only Up to 2,250


Optimized for compute-
intensive workloads 2,250
c5.4xlarge 16 32 EBS-Only

4,500
c5.9xlarge 36 72 EBS-Only

c5.18xlarge 72 144 EBS-Only 9,000

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 – Memory Optimized Example

Networking
Mem Dedicated EBS
Model vCPU Storage (GiB) Performance
(GiB) Bandwidth (Mbps)
(Gbps)

r5.large 2 16 EBS-Only up to 3,500 Up to 10

r5.xlarge 4 32 EBS-Only up to 3,500 Up to 10

r5.2xlarge 8 64 EBS-Only up to 3,500 Up to 10


Memory heavy applications or
r5.4xlarge 16 128 EBS-Only 3,500 Up to 10
when you need more RAM than
CPU r5.12xlarge 48 384 EBS-Only 7,000 10

r5.24xlarge 96 768 EBS-Only 14,000 25

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 – Accelerated Computing Example

GPU Mem
Model GPUs vCPU Mem (GiB) GPU P2P
(GiB)

p3.2xlarge 1 8 61 16 -

Performant GPU-based instances p3.8xlarge 4 32 244 64 NVLink

Commonly used for


machine/deep learning p3.16xlarge 8 64 488 128 NVLink

p3.dn24x 12 96 768 256 NVLink

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 – Storage Optimized Example

Mem Networking Instance


Model vCPU
(GiB) Performance Storage (GB)

h1.2xlarge 8 32 Up to 10 Gigabit 1 x 2,000 HDD

h1.4xlarge 16 64 Up to 10 Gigabit 2 x 2,000 HDD

Up to 16 TB of HDD-based local
storage with high disk h1.8xlarge 32 128 10 Gigabit 4 x 2,000 HDD
throughput

h1.16xlarge 64 256 25 Gigabit 8 x 2,000 HDD

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intel® Xeon CPUs and EC2 Instances
All current EC2 instance types include:
• Intel AES-NI: Reduces performance hit due to encryption
• Intel AVX (AVX2, AVX-512): Improve floating-point
performance. Only available on HVM deployments.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intel® Xeon CPUs and EC2 Instances
Some EC2 instance types include:
• Intel Turbo Boost: Runs cores faster than base clock speed when
needed
• Intel TSX: Uses multiple threads or single thread depending on need
• P state and C state control: Fine-tune performance and sleep state of
each core
• Intel® Deep Learning Boost: Embedded performance acceleration
for Artificial Intelligence workloads. Up to 30x performance
improvement for inference workloads compared to the previous
generation.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intel Processors for Your Workloads

AVX 512
Deep Learning Boost TSX

AES-NI Turbo Boost


Threat Detection
Technology (TDT)

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intel® Xeon Scalable Processors
Latest generation of Intel Xeon processors
Up to:
• 28 cores per CPU
• 6 memory channels
• 48 PCIe lanes of bandwidth/throughput
• 100 Gbps network bandwidth (C5n.16xlarge)

Intel AVX-512:
• Twice the floating-point performance of AVX2
• 512-bit instructions (vs 256 for AVX/AVX2)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intel® Xeon Family and EC2 Instances
Intel Xeon Scalable Intel Xeon E5 Intel Xeon E7
Processor Family Processor Family Processor Family
• High Memory • M4 • X1/X1e
• z1d • R4
• C5/C5n • P2/P3
• M5 • G3
• R5 • F1
• T3 • H1
• I3
• D2

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Instance Generations and Cost
Newer generation instances generally have better
price-to-performance ratios
SQL Server Testing with HammerDB:
Average Cost Per 1 Billion Transactions Per Month
$60.00 $56.61

$50.00
$43.08
$40.00

$30.00

$20.00

$10.00

$0.00
m4.xlarge m5.xlarge

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Pricing Options

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Pricing Options

On-Demand Instances Reserved Instances Savings Plans Spot Instances

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
On-Demand Instances

• Pay for compute capacity per second (Amazon Linux and Ubuntu) or by the hour (all
other OS)

• No long-term commitments

• No upfront payments

• Increase or decrease your compute capacity depending on the demands of your


application

Solves the need for immediate compute capacity

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reserved Instances

Can provide a significant discount for your architectures.

• Pre-pay for capacity

• Standard RI, Convertible RIs, Scheduled RIs

• Three upfront payment methods

• Can be shared between multiple accounts (within a billing family)

Provides the ability to reserve capacity ahead of time, reducing cost

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Savings Plans

• Compute Savings Plans provide the most flexibility and help to reduce your costs
by up to 66%

• EC2 Instance Savings Plans apply to a specific instance family within a Region and
provide the largest discount (up to 72%, just like Standard RIs)

Don’t have to coordinate your RI purchases

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot Instances

• Purchase unused Amazon EC2 capacity

• No more bidding! – prices based on long term trends of supply & demand

• Interruption notice provided 2 minutes prior to instance termination

• Flexibility is the key to success

Spot can provide up to 90% off on-demand pricing. Spot Instances are
appropriate for stateless, fault-tolerant workloads.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Dedicated Options

Dedicated Instances Dedicated Hosts

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Dedicated Instances
Dedicated instances are physically isolated
from other AWS accounts

Dedicated Instances

Helps meet requirements for regulatory


compliance or software license use

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Dedicated Hosts

A dedicated host is a full physical server with EC2


Dedicated Hosts
instance capacity fully dedicated to your use.

Host ID: h-039725dyhe980010

Helps meet strict requirements for regulatory


compliance or software license use

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Tenancy

Only your AWS


account on the Description
hardware?
Default No Your instance runs on shared hardware.
Dedicated
Yes Runs on a non-specific piece of hardware.
Instance
Runs on a specific piece of hardware of your choosing, over
Dedicated Host Yes
which you receive greater control.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Compute Optimizer

AWS Compute Optimizer recommends optimal AWS compute resources for your workloads to reduce
costs and improve performance by using machine learning to analyze historical utilization metrics.

Lower costs by up to Optimize performance with


25% actionable recommendations

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Keeping Track of Your Instances

Assign metadata tags to your AWS resources to help you:

Manage Search Filter

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tagging Best Practices

• Standardized, case-sensitive format for tags

• Implement automated tools to help manage resource tags

• Favor using too many tags rather than too few

• Remember, it’s easy to modify tags

• Examples: App Version, ENV, DNS Name, App Stack Identifier

Helps you to understand what your resources are doing and their cost impact.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Considerations

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural Considerations 1

Does your compute layer require the lowest latency and highest packet-per-
second network performance possible?

Cluster Placement Groups

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural Considerations 2

Do you have applications that have a small number of critical instances that
should be kept separate from each other?

Spread Placement Groups

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural Considerations 3

Do you have large distributed and replicated workloads such as HDFS,


HBase and Cassandra running on EC2?

Partition Placement Groups

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Checks

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 4

What is an AMI? 1. An AMI is an object that stores data about the instance
such as Local Hostname, Instance ID, or Public IP
address.

2. It provides block-level storage that will disappear on


instance shutdown.

3. AMIs are used to create new EC2 instances and contain a


template for the root volume.

4. A type of storage bucket for Amazon S3.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 4: Answer

What is an AMI? 1. An AMI is an object that stores data about the instance
such as Local Hostname, Instance ID, or Public IP
address.

2. It provides block-level storage that will disappear on


instance shutdown.

3. AMIs are used to create new EC2 instances and


contain a template for the root volume.

4. A type of storage bucket for Amazon S3.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 5

If you wanted to select the host on which an instance would run, which
option should you use?

1. Default

2. Dedicated instance

3. Dedicated Host

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 5: Answer

If you wanted to select the host on which an instance would run, which
option should you use?

1. Default

2. Dedicated instance

3. Dedicated Host

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 6

What is Amazon EBS? 1. Object storage solution that can scale to incredible sizes to
meet demand and storage requirements

2. Block storage device that can connect to multiple


instances at the same time.

3. File storage system that can connect to multiple instances


at the same time.

4. Block storage device that connects to one instance at a


time. Can be backed up to Amazon S3.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Knowledge Check 6: Answer

What is Amazon EBS? 1. Object storage solution that can scale to incredible sizes to
meet demand and storage requirements

2. Block storage device that can connect to multiple


instances at the same time.

3. File storage system that can connect to multiple instances


at the same time.

4. Block storage device that connects to one instance at a


time. Can be backed up to Amazon S3.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank You

© 2020 Amazon Web Services, Inc. or its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior
written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited. Corrections, feedback, or other questions? Contact
us at https://support.aws.amazon.com/#/contacts/aws-training. All trademarks are the property of their owners.

You might also like