2.1 Amazon EC2 Instance

Overview

An instance is a virtual server in the cloud. Its configuration at launch is a copy of the AMI that you specified when you launched the instance.

You can launch different types of instances from a single AMI. An instance type essentially determines the hardware of the host computer used for your instance.There are dozens of instance types available, varying in the following dimensions:

  • Virtual CPUs (vCPUs)
  • Memory
  • Storage (size and type)
  • Network performance

Instance types are grouped into families based on the ratio of these values to each other.

General Purpose

General purpose instances provide a balance of compute, memory and networking resources, and is Ideal for applications that use these resources in equal proportions

M5 and M5a instances

These instances provide an ideal cloud infrastructure, offering a balance of compute, memory, and networking resources for a broad range of applications that are deployed in the cloud. They are well-suited for the following:

  • Small and midsize databases

  • Data processing tasks that require additional memory

  • Caching fleets

  • Backend servers for SAP, Microsoft SharePoint, cluster computing, and other enterprise applications

M5zn

These instances are ideal for applications that benefit from extremely high single-thread performance, high throughput, and low latency networking. They are well-suited for the following:

  • Gaming

  • High performance computing

  • Simulation modeling

M6g and M6gd instances

These instances are powered by AWS Graviton2 processors and deliver balanced compute, memory, and networking for a broad range a general purpose workloads. They are well suited for the following:

  • Application servers

  • Microservices

  • Gaming servers

  • Midsize data stores

  • Caching fleets

Mac1 instances

These instances are powered by Apple Mac mini computers. They provide up to 10 Gbps of network bandwidth and 8 Gbps EBS bandwidth through high-speed Thunderbolt 3 connections. They are well suited to develop, build, test, and sign applications for Apple devices, such as iPhone, iPad, iPod, Mac, Apple Watch, and Apple TV.

T2, T3, T3a, and T4g instances(Burstable performance instances)

These instances provide a baseline level of CPU performance with the ability to burst to a higher level when required by your workload. An Unlimited instance can sustain high CPU performance for any period of time whenever required. They are well-suited for the following:

  • Websites and web applications

  • Code repositories

  • Development, build, test, and staging environments

  • Microservices

Burstable performance instance requirements

  • The supported instance families are: T2, T3, T3a, and T4g.

  • The supported purchasing options are: On-Demand Instances, Reserved Instances, Dedicated Instances, and Spot Instances. These instances are not supported on a Dedicated Host

  • Ensure that the instance size you choose passes the minimum memory requirements of your operating system and applications.

Best practices

Follow these best practices to get the maximum benefit from burstable performance instances.

  • Use a recommended AMI – Use an AMI that provides the required drivers.

  • Turn on instance recovery – Create a CloudWatch alarm that monitors an EC2 instance and automatically recovers it if it becomes impaired for any reason.

CPU credits 

  • A CPU Credit provides the performance of a full CPU core for one minute​​​​the following scenarios all use one CPU credit:
    • One vCPU at 100% utilization for one minute

    • One vCPU at 50% utilization for two minutes

    • Two vCPUs at 25% utilization for two minutes

  • The baseline utilization and ability to burst are governed by CPU credits.
  • Each T instance receives CPU Credits continuously, the rate of which depends on the instance size
  • If the instance does not use the credits it receives, they are stored in its CPU Credit balance
  • While earned credits never expire on a running instance, there is a limit to the number of earned credits that an instance can accrue. 
    • For T2, the CPU credit balance does not persist between instance stops and starts. If you stop a T2 instance, the instance loses all its accrued credits.

    • For T3 and T4g, the CPU credit balance persists for seven days after an instance stops and the credits are lost thereafter. 

    • Maximum earned credit balance for an instance is equal to the number of CPU credits received per hour times 24 hours

Launch credits

  • T2 Standard instances receive Launch credits to provide a good startup experience, but T2 Unlimited instances do not(no need). 

  • T3 and T4g instances(Standard  or Unlimited) never receive launch credits.

  • T2 Standard instances get 30 launch credits per vCPU at launch or start.

  • Launch credits are spent first, before earned credits. Unspent launch credits are accrued in the CPU credit balance, but do not count towards the CPU credit balance limit.

  • There is a limit to the number of times T2 Standard instances can receive launch credits. The default limit is 100 launches or starts of all T2 Standard instances combined per account, per Region, per rolling 24-hour period. 

  • 2.1 Amazon EC2 Instance_第1张图片

Baseline utilization

  • A percentage of vCPU utilization, which is calculated as follows:
    • (number of credits earned/number of vCPUs)/60 minutes = % baseline utilization
    • t3.nano instance, with 2 vCPUs, earns 6 credits per hour, resulting in a baseline utilization of 5% ((6/2)/60).

    • t3.xlarge instance, with 4 vCPUs, earns 96 credits per hour, resulting in a baseline utilization of 40% ((96/4)/60).

Unlimited mode

  • The unlimited mode is a credit configuration option for burstable performance instances.

  • It can be enabled or disabled at any time for a running or stopped instance.

  • You can set unlimited as the default credit option at the account level per AWS Region, per burstable performance instance family

  • A burstable performance instance configured as unlimited can sustain high CPU utilization for any period of time whenever required.

  • If a burstable performance instance configured as unlimited depletes its CPU credit balance, it can spend surplus credits to burst beyond the baseline. When its CPU utilization falls below the baseline, it uses the CPU credits that it earns to pay down the surplus credits that it spent earlier.

  • The hourly instance price automatically covers all CPU usage spikes if the average CPU utilization of the instance is at or below the baseline over a rolling 24-hour period or the instance lifetime, whichever is shorter.

    • If you use a t2.micro or t3.micro instance under the AWS Free Tier offer and use it in unlimited mode, charges might apply if your average utilization over a rolling 24-hour period exceeds the baseline utilization of the instance.

    • T3 and T4g instances launch as unlimited by default. If the average CPU usage over a 24-hour period exceeds the baseline, you incur charges for surplus credits

  • The breakeven CPU usage helps you determine when to use unlimited mode versus fixed CPU:

    • If the average CPU usage over a 24-hour period is at or below the breakeven CPU usage, use a burstable performance instance in unlimited mode so that you can benefit from the lower price of a burstable performance instance while getting the same performance as a fixed performance instance.

    • If the average CPU usage over a 24-hour period is above the breakeven CPU usage, the burstable performance instance will cost more than the equivalently-sized fixed performance instance. If a T3 instance continuously bursts at 100% CPU, you end up paying approximately 1.5 times the price of an equivalently-sized M5 instance.2.1 Amazon EC2 Instance_第2张图片

  • Surplus credits that were spent earlier are charged when any of the following occurs:

    • The spent surplus credits exceed the maximum number of credits the instance can earn in a 24-hour period. Spent surplus credits above the maximum are charged at the end of the hour.

    • The instance is stopped or terminated.

    • The instance is switched from unlimited to standard.

    • Spent surplus credits are tracked by the CloudWatch metric CPUSurplusCreditBalance. Surplus credits that are charged are tracked by the CloudWatch metric CPUSurplusCreditsCharged

  • CPUCreditBalance is a CloudWatch metric that tracks the number of credits accrued by an instance. CPUSurplusCreditBalance is a CloudWatch metric that tracks the number of surplus credits spent by an instance.

  • When you change an instance configured as unlimited to standard, the following occurs:

    • The CPUCreditBalance value remains unchanged and is carried over.

    • The CPUSurplusCreditBalance value is immediately charged.

  • When a standard instance is switched to unlimited, the following occurs:

    • The CPUCreditBalance value containing accrued earned credits is carried over.

    • For T2 Standard instances, any launch credits are removed from the CPUCreditBalance value, and the remaining CPUCreditBalance value containing accrued earned credits is carried over.

Standard mode

  • A burstable performance instance configured as standard is suited to workloads with an average CPU utilization that is consistently below the baseline CPU utilization of the instance.
  • To burst above the baseline, the instance spends credits that it has accrued in its CPU credit balance. If the instance is running low on accrued credits, CPU utilization is gradually lowered to the baseline level
  • For T2 Standard, when the instance is stopped, it loses all its accrued credits
  • For T3 and T4g Standard instances, the CPU credit balance persists for seven days after the instance stops and the credits are lost thereafter

Compute Optimized

Ideal for compute bound applications that benefit from high performance processors

C5 and C5n instances

These instances are well suited for the following:

  • Batch processing workloads

  • Media transcoding

  • High-performance web servers

  • High-performance computing (HPC)

  • Scientific modeling

  • Dedicated gaming servers and ad serving engines

  • Machine learning inference and other compute-intensive applications

C6g, C6gd, and C6gn instances

These instances are powered by AWS Graviton2 processors and are ideal for running advanced, compute-intensive workloads, such as the following:

  • High-performance computing (HPC)

  • Batch processing

  • Ad serving

  • Video encoding

  • Gaming servers

  • Scientific modeling

  • Distributed analytics

  • CPU-based machine learning inference

Instance performance

  • EBS-optimized instances enable you to get consistently high performance for your EBS volumes by eliminating contention between Amazon EBS I/O and other network traffic from your instance. Some compute optimized instances are EBS-optimized by default at no additional cost.
  • Some compute optimized instance types provide the ability to control processor C-states and P-states on Linux. C-states control the sleep levels that a core can enter when it is inactive, while P-states control the desired performance (in CPU frequency) from a core

Network performance

  • You can enable enhanced networking on supported instance types to provide lower latencies, lower network jitter, and higher packet-per-second (PPS) performance.
  • Some instances use a network I/O credit mechanism to allocate network bandwidth to instances based on average bandwidth utilization. They accrue credits when their bandwidth is below their baseline bandwidth, and can use these credits when they perform network data transfers. 

Memory Optimized

Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.

R5, R5a, R5b, and R5n instances

These instances are well suited for the following:

  • High-performance, relational (MySQL) and NoSQL (MongoDB, Cassandra) databases.

  • Distributed web scale cache stores that provide in-memory caching of key-value type data (Memcached and Redis).

  • In-memory databases using optimized data storage formats and analytics for business intelligence (for example, SAP HANA).

  • Applications performing real-time processing of big unstructured data (financial services, Hadoop/Spark clusters).

  • High-performance computing (HPC) and Electronic Design Automation (EDA) applications.

R6g and R6gd instances

These instances are powered by AWS Graviton2 processors and are ideal for running memory-intensive workloads, such as the following:

  • Open-source databases (for example, MySQL, MariaDB, and PostgreSQL)

  • In-memory caches (for example, Memcached, Redis, and KeyDB)

High memory instances

These instances offer 6 TiB, 9 TiB, 12 TiB, 18 TiB, and 24 TiB of memory per instance. They are designed to run large in-memory databases, including production deployments of the SAP HANA in-memory database.

X1 instances

These instances are well suited for the following:

  • In-memory databases such as SAP HANA, including SAP-certified support for Business Suite S/4HANA, Business Suite on HANA (SoH), Business Warehouse on HANA (BW), and Data Mart Solutions on HANA. 

  • Big-data processing engines such as Apache Spark or Presto.

  • High-performance computing (HPC) applications.

X1e instances

These instances are well suited for the following:

  • High-performance databases.

  • In-memory databases such as SAP HANA

  • Memory-intensive enterprise applications.

X2gd instances

These instances are well suited for the following:

  • In-memory databases, such as Redis and Memcached.

  • Relational databases, such as MySQL and PostGreSQL.

  • Electronic design automation (EDA) workloads, such as physical verification and layout tools.

  • Memory-intensive workloads, such as real-time analytics and real-time caching servers.

z1d instances

These instances deliver both high compute and high memory and are well-suited for the following:

  • Electronic Design Automation (EDA)

  • Relational database workloads

Memory performance

  • X1 instances include Intel Scalable M​​emory Buffers, providing 300 GiB/s of sustainable memory-read bandwidth and 140 GiB/s of sustainable memory-write bandwidth.
  • Memory optimized instances have high memory and require 64-bit HVM AMIs to take advantage of that capacity. 

Instance performance

  • Memory optimized instances enable increased cryptographic performance through the latest Intel AES-NI feature, support Intel Transactional Synchronization Extensions (TSX) to boost the performance of in-memory transactional data processing, and support Advanced Vector Extensions 2 (Intel AVX2) processor instructions to expand most integer commands to 256 bits.
  • Some memory optimized instances provide the ability to control processor C-states and P-states on Linux. C-states control the sleep levels that a core can enter when it is inactive, while P-states control the desired performance (measured by CPU frequency) from a core. 

Accelerated Computing

Accelerated computing instances use hardware accelerators, or co-processors, to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.

GPU instances

GPU-based instances provide access to NVIDIA GPUs with thousands of compute cores. You can use these instances to accelerate scientific, engineering, and rendering applications by leveraging the CUDA or Open Computing Language (OpenCL) parallel computing frameworks. You can also use them for graphics applications, including game streaming, 3-D application streaming, and other graphics workloads.

Instances with AWS Inferentia

These instances are designed to accelerate machine learning using AWS Inferentia, a custom AI/ML chip from Amazon that provides high performance and low latency machine learning inference. These instances are optimized for deploying Deep Learning (DL) models for applications, such as natural language processing, object detection and classification, content personalization and filtering, and speech recognition.

FPGA instances

FPGA-based instances provide access to large FPGAs with millions of parallel system logic cells. You can use FPGA-based accelerated computing instances to accelerate workloads such as genomics, financial analysis, real-time video processing, big data analysis, and security workloads by leveraging custom hardware accelerations.

Storage Optimized

Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.

D2 instances

These instances are well suited for the following:

  • Massive parallel processing (MPP) data warehouse

  • MapReduce and Hadoop distributed computing

  • Log or data processing applications

D3 and D3en instances

These instances offer scale out of instance storage and are well suited for the following:

  • Distributed file systems for Hadoop workloads

  • File storage workloads such as GPFC and BeeFS

  • Large data lakes for HPC workloads

H1 instances

These instances are well suited for the following:

  • Data-intensive workloads such as MapReduce and distributed file systems

  • Applications requiring sequential access to large amounts of data on direct-attached instance storage

  • Applications that require high-throughput access to large quantities of data

I3 and I3en instances

These instances are well suited for the following:

  • High frequency online transaction processing (OLTP) systems

  • Relational databases

  • NoSQL databases

  • Cache for in-memory databases (for example, Redis)

  • Data warehousing applications

  • Distributed file systems

Instance performance

  • To ensure the best disk throughput performance from your instance on Linux, we recommend that you use the most recent version of Amazon Linux 2 or the Amazon Linux AMI.
  • For instances with NVMe instance store volumes, you must use a Linux AMI with kernel version 4.4 or later. Otherwise, your instance will not achieve the maximum IOPS performance available.
  • D2 instances provide the best disk performance when you use a Linux kernel that supports persistent grants, an extension to the Xen block ring protocol that significantly improves disk throughput and scalability. 
  • EBS-optimized instances enable you to get consistently high performance for your EBS volumes by eliminating contention between Amazon EBS I/O and other network traffic from your instance. Some storage optimized instances are EBS-optimized by default at no additional cost. 
  • Some storage optimized instance types provide the ability to control processor C-states and P-states on Linux. C-states control the sleep levels that a core can enter when it is inactive, while P-states control the desired performance (in CPU frequency) from a core. 

Instance Features

AMI virtualization types

  • The virtualization type of your instance is determined by the AMI that you use to launch it.
    • Current generation instance types support hardware virtual machine (HVM) only.
    • Some previous generation instance types support paravirtual (PV) and some AWS Regions support PV instances.
  • For best performance, we recommend that you use an HVM AMI.
  • In addition, HVM AMIs are required to take advantage of enhanced networking. 

Instances built on the Nitro System

  • The Nitro System is a collection of AWS-built hardware and software components that enable high performance, high availability, and high security. 
  • The Nitro System provides bare metal capabilities that eliminate virtualization overhead and support workloads that require full access to host hardware. Bare metal instances are well suited for the following:
    • Workloads that require access to low-level hardware features (for example, Intel VT) that are not available or fully supported in virtualized environments

    • Applications that require a non-virtualized environment for licensing or support

  • The following instances are built on the Nitro System:

    • Virtualized: A1, C5, C5a, C5ad, C5d, C5n, C6g, C6gd, C6gn, D3, D3en, G4, I3en, Inf1, M5, M5a, M5ad, M5d, M5dn, M5n, M5zn, M6g, M6gd, p3dn.24xlarge, P4, R5, R5a, R5ad, R5b, R5d, R5dn, R5n, R6g, R6gd, T3, T3a, T4g, high memory (u-*), X2gd, and z1d

    • Bare metala1.metalc5.metalc5d.metalc5n.metalc6g.metalc6gd.metali3.metali3en.metalm5.metalm5d.metalm5dn.metalm5n.metalm5zn.metalm6g.metalm6gd.metalmac1.metalr5.metalr5b.metalr5d.metalr5dn.metalr5n.metalr6g.metalr6gd.metalu-6tb1.metalu-9tb1.metalu-12tb1.metalu-18tb1.metalu-24tb1.metalx2gd.metal, and z1d.metal

Multiple Storage Options

  • Amazon EBS
    •  Amazon EBS is a durable, block-level storage volume that you can attach to a single, running Amazon EC2 instance.
    • Amazon EBS volumes persist independently from the running life of an Amazon EC2 instance.
    • You can also generate an AMI image directly from a running instance-attached EBS volume—although, to be sure no data is lost, it’s best to shut down the instance first.

      EBS volumes can be

2.1 Amazon EC2 Instance_第3张图片 ​

  • Instance store
    • Instance store volumes are SSDs that are physically attached to the server hosting your instance and are connected via a fast NVMe interface, instance store volumes offer fast data access
    • provides temporary block-level storage for Amazon EC2 instances.
    • The data on an instance store volume persists only during the life of the associated Amazon EC2 instance.
    • ideal for temporary storage of information that changes frequently, such as buffers, caches, scratch data, and other temporary content, or for data that is replicated across a fleet of instances, such as a load-balanced pool of web servers.

    • Data in the instance store is lost when:

      • The underlying disk drive fails.
      • The instance stops (the data will persist if an instance reboots).
      • The instance terminates
  • Amazon S3
    • highly durable, highly available object storage

EBS-optimized Instances

  • EBS-optimized instances enable EC2 instances to fully use the IOPS provisioned on an EBS volume by eliminating contention between Amazon EBS I/O and other network traffic from your instanceproviding the best performance for your EBS volumes.
  • EBS-optimized instances deliver dedicated throughput between Amazon EC2 and Amazon EBS
  • We recommend using Provisioned IOPS volumes with EBS-optimized instances or instances that support cluster networking for applications with high storage I/O requirements.
  • Provisioned IOPS—which in some contexts is referred to as EBS Optimized

Cluster Networking

  • A cluster placement group provides low-latency networking between all instances in the cluster.
  •  When launched in a placement group, instances can utilize up to 10 Gbps for single-flow traffic and up to 100 Gbps for multi-flow traffic. Network traffic to the Internet is limited to 5 Gbps
  •  Cluster networking is ideal for high performance analytics systems and many science and engineering applications, especially those using the MPI library standard for parallel programming.

Enhanced Networking

  • For workloads requiring greater network performance

  • Enhanced networking reduces the impact of virtualization on network performance by enabling a capability called Single Root I/O Virtualization (SR-IOV). This results in more Packets Per Second (PPS), lower latency, and less jitter.

  • Enhanced networking is available only for instances launched in an Amazon VPC(Amazon Virtual Private Cloud)

  • Some instances use a network I/O credit mechanism to allocate network bandwidth to instances based on average bandwidth utilization. They accrue credits when their bandwidth is below their baseline bandwidth, and can use these credits when they perform network data transfers

Change the instance type

  • If the root device for your instance is an EBS volume, you can change the size of the instance by changing its instance type.

  • If the root device for your instance is an instance store volume, you must migrate your application to a new instance with the instance type that you need.

  • You must select an instance type that is compatible with the configuration of the instance. If the instance type that you want is not compatible with the instance configuration you have, then you must migrate your application to a new instance with the instance type that you need.

  • To change the instance type, the instance must be in the stopped state.

  • You cannot resize an instance if hibernation is enabled.

Reference:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html

https://aws.amazon.com/ec2/?ec2-whats-new.sort-by=item.additionalFields.postDateTime&ec2-whats-new.sort-order=desc

AWS Certified Solutions Architect Official Study Guide - Associate

AWS Certified Solutions Architect Study Guide- Associate 2nd Edition

你可能感兴趣的:(AWS,Certification,#,AWS,Compute)