Advertisement

2.1 Amazon EC2 Instance

阅读量:

Overview

An instance represents a virtual machine instance in the public cloud. Its configuration at startup is configured as a copy of the Amazon Machine Image (AMI) that you specified during its creation.

You can create various instances from a single AMI. The instance type primarily determines the hardware configuration of the host computer. The range of available instance types is vast, varying across several key categories.

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

Instance types are categorized into families according to the ratios between these quantities and one another.

General Purpose

General purpose instances provide a balanced allocation of computational, memory, and networking resources, and are designed for applications that require balanced allocation of these resources.

M5 and M5a instances

These instances offer an ideal cloud infrastructure, harmoniously integrating compute, memory, and networking resources to support a variety of applications that are hosted in the cloud. These instances are capable of supporting the following scenarios:

Small and midsize databases

Data processing tasks that require additional memory

Caching fleets

Application servers supporting SAP ERP systems and Microsoft Dynamics 365 Business Central solutions. These application servers are designed to handle distributed computing environments and provide robust support for a variety of enterprise applications.

M5zn

These instances are highly suitable for applications requiring exceptionally high single-threaded activity, maximized data transfer rates, and low-latency networking. Such instances are particularly suited to scenarios where minimal delay and optimal throughput are essential.

Gaming

High performance computing

Simulation modeling

M6g and M6gd instances

These instances are built upon AWS Graviton2 processors and offer a balanced allocation of compute, memory, and networking resources for a broad range of general-purpose computing tasks. Ideal for these scenarios:

Application servers

Microservices

Gaming servers

Midsize data stores

Caching fleets

Mac1 instances

These instances are equipped with Apple Mac mini computers. Each instance offers a maximum of 10 gigabits per second for network bandwidth and up to 8 gigabits per second for EBS bandwidth via high-speed Thunderbolt 3 connections. These systems are ideal for developing、building applications or components on various Apple devices including the iPhone、iPad、iPod、Mac、Apple Watch、and Apple TV.

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

These instances offer a differentiated base performance level, enabling them to wake up to increased levels when your workload demands. An Unlimited instance allows sustained high CPU utilization across extended periods when needed. Avoid these instances if you...

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 available purchasing options include Demand-Driven Instances, Prereserved Instances, Dedicated Instances, and Instantaneous Instances. These options are unavailable when a Dedicated Host is selected because they necessitate exclusive resource allocation.

Make sure that the size of the instance you have chosen must meet the minimum memory requirements of your system and applications.

Best practices

By adhering to best practices, you can achieve the greatest advantage from burstable performance instances.

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

Enable instance recovery by setting up a CloudWatch alarm that monitors an EC2 instance, automatically initiating a recovery process if it ever becomes impaired.

CPU credits

A CPU Credit simulates the performance equivalent to a full CPU core running for one minute, while all subsequent scenarios utilize a single CPU credit unit.

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 base utilization and burst capability are controlled by CPU credits.

    • The T instances continuously incur CPU Credits, with a frequency that is influenced by their size.
  • If the instance doesn’t utilize the credits it receives, they are kept in its CPU Credit balance.

    • While credits never expire for running instances, a cap exists for how many credits an instance can accumulate.

Upon stopping a T2 instance, its CPU's credit balance ceases to carry over between restarts. Once stopped, these instances lose all their accumulated credits.

Of instances of types T3 and T4g, its CPU credit balance remains valid for a duration of seven days once an instance has terminated service, after which the credits are subsequently invalidated.

实例每天的CPU信用乘以天数等于实例累积的最大信用限额

Launch credits

standard T2 instances are granted launch credits to offer a favorable startup environment, but T2 unlimited instances do not benefit from additional advantages.

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 used up first, before they are earned. Unspent launch credits are recorded as CPU credit balance, but they are excluded from the CPU credit balance limit.

Each account has a cap on the number of launch attempts for T2 Standard instances. By default, there are 100 launches or starts across all T2 Standard instances in each account, region, and 24-hour window.

Baseline utilization

  • A portion of vCPU utilization, which is computed as follows:
  • (\text{number of credits earned}/\text{number of vCPUs})/\text{60 minutes} = \text{\% baseline utilization}

一个具有t3.nano配置的实例,在拥有2个vCPUs的情况下,每小时产生6个信用单位(通过计算公式(6/2)/60实现了5%的基础利用率)。

A t3.xlarge instance generates 96 credits per hour and leads to a base utilization rate of 40% (calculated as (96/4)/60).

Unlimited mode

This mode represents an unbounded credit configuration parameter, enabling the allocation of resources in a cost-efficient manner for high-performance computing instances that require fluctuating capacity.

It can be enabled/disabled anytime for an active or inactive system.

You can define unlimited as the default credit option within each AWS Region’s account level for all instances within a burstable performance instance family.

This instance, when needed, can handle high CPU utilization. This burstable performance configuration ensures consistent high CPU load handling.

If a burstable performance instance configured as unlimited exhausts its CPU credit balance, it will **utilize extra credits to exceed the baseline. Once its CPU utilization drops below the baseline threshold, it will **allocate the earned CPU credits to settle the surplus credits utilized previously.

Every hour's pricing for instances ensures coverage of all CPU spikes when average utilization over a rolling 24-hour window remains at or below the set baseline, providing coverage up to the instance's operational lifespan.

You are utilizing an instance of type t2.micro or t3.micro under the AWS Free Tier offer when used in unlimited mode. It could potentially result in being charged if your average 24-hour period's utilization exceeds that baseline.

T3 and T4g instances are instantiated with default unlimited capacity. When the average CPU utilization per day surpasses the baseline threshold, users are billed for any excess computing resources.

The breakeven CPU usage assists in determining whether to employ unlimited mode compared to fixed CPU.

Only when the mean CPU utilization over a 24-hour period does not exceed the breakeven threshold should you opt for a burstable performance instance configured in unlimited mode. Such an arrangement enables both cost-effectiveness and equivalent performance levels compared to fixed instances.

When the mean CPU usage over a 24-hour period exceeds the break-even point for CPU usage, burstable performance instances will exceed in cost the equivalent fixed-performance instances. When a T3 instance operates at full capacity continuously, it would incur approximately 1.5 times the cost of an equivalently sized M5 instance.

Previously spent surplus credits are subject to charging whenever any of these conditions arise.

The spent surplus credits surpass the maximum permissible credit limit assigned to an AWS EC2 performance instance over a 24-hour period. Excess surplus credits exceeding this threshold are subject to allocation-based billing charges at the end of each billing cycle.

The instance is stopped or terminated.

The instance is switched from unlimited to standard.

The spent surplus credits are being monitored by the CloudWatch metric CPUSurplusCreditBalance. This allows for tracking of credit utilization. Surplus credits that have been charged are being followed by the CloudWatch metric CPUSurplusCreditsCharged. This ensures monitoring of charges applied.

The CPUCreditBalance metric represents a CloudWatch measurement tracking the accumulated credits for an instance. The CPUSurplusCreditBalance metric represents a CloudWatch measurement tracking the utilization of surplus credits by an instance.

When modifying an instance configured to unlimited, this change will result in the instance being set to the standard configuration.

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 instance including accumulated earned credits will be carried over.

For T2 Standard instances, all launch credits are subtracted from the CPUCreditBalance value, and the remainder of the CPUCreditBalance value, which includes accrued earned credits, is retained.

Standard mode

  • A burstable performance instance of the standard type is suitable for workloads with an average CPU utilization consistently below the baseline CPU utilization of the instance.
    • The instance utilizes credits that it has accumulated in its CPU credit balance. When the instance has limited credits, CPU utilization is gradually reduced to the baseline level.
    • For T2 Standard instances, stopping them results in the exhaustion of all their accrued credits.
    • For T3 and T4g Standard instances, their CPU credit balance persists for seven days after they are stopped, and their credits are then exhausted thereafter.

Compute Optimized

Highly effective for compute-bound applications, these systems are highly effective due to their ability to leverage 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

Each of these instances is powered by AWS Graviton2 processors and is designed to handle highly advanced and compute-heavy tasks, including 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优化实例能够提供一致的高性能以解决亚马逊EBS I/O与其他网络流量之间的竞争问题,并且一些计算优化实例在无需额外费用的情况下即为EBS优化配置。
一些计算优化实例类型提供了管理处理器C状态和P状态的能力。C状态决定了空闲时核心能够进入的睡眠级别,而P状态则决定了核心的理想性能(以CPU频率表示)。

Network performance

  • Supported instances offer enhanced networking capabilities, which enable lower latencies, reduced network jitter, and increased packet-per-second (PPS) performance.
  • Some instances utilize a network I/O credit system to allocate network bandwidth based on average utilization. When these instances operate below their baseline bandwidth, they accumulate credits that can be used for network data transfers.

Memory Optimized

Optimized memory instances are engineered to provide high-speed performance for workloads that handle large datasets entirely within memory.

R5, R5a, R5b, and R5n instances

These instances are well suited for the following:

High-performance relational databases such as MySQL and NoSQL databases including MongoDB and Cassandra are widely utilized in modern systems.

这些分布式缓存存储系统能够支持内存中的键值对数据缓存操作(包括Memcached和Redis)。

In-memory databases employ optimised data storage formats and associated analytics to support business intelligence operations, such as those found in SAP HANA.

Applications executing real-time data processing of massive unstructured datasets in the financial sectors, such as Hadoop/Spark clusters.

High-performance computing (HPC) and Electronic Design Automation (EDA) are integral to modern computational tasks.

R6g and R6gd instances

These instances are equipped with AWS Graviton2 processors and are optimized for handling memory-intensive tasks, such as those mentioned below.

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

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

High memory instances

These instances provide memory capacities ranging from 6 TiB to 24 TiB per instance. Each instance is capable of running large-scale in-memory databases, such as 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 certified support of the SAP Business Suite S/4HANA, The Business Suite for HANA (SoH), The Business Warehouse for HANA (BW), and Data Mart Solutions for 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, including physical simulation and layout tools as well.

These memory-heavy workloads include real-time data analysis systems and cache servers.

z1d instances

These instances offer both high compute and high memory capabilities, being optimally adapted to the following applications.

Electronic Design Automation (EDA)

Relational database workloads

Memory performance

  • X1实例采用了Intel可扩展内存缓冲区配置(M​​),提供了sustaining的内存读取吞吐量(300 GiB/s)以及内存写入吞吐量(140 GiB/s)。
  • Memory-optimized实例具备丰富的内存资源,并要求使用**64-bit HVM Application Memory Images (AMIs)**以充分利用其潜力。

Instance performance

  • 基于内存优化的实例借助最新Intel AES-NI技术实现了加密性能的显著提升,并通过支持Intel TSX技术优化内存事务处理性能;此外还支持Intel AVX2指令集扩展多数整数指令至256位。
  • 某些基于内存优化的实例提供了控制处理器C状态和P状态的能力(仅限Linux系统)。其中C状态决定了核心在无活性时可进入的睡眠级别;而P状态则决定了核心的理想性能(通过CPU频率衡量)。

Accelerated Computing

Accelerated computing instances are designed to utilize dedicated hardware accelerators or specialized co-processors to execute tasks such as floating-point arithmetic operations, visual processing tasks, or data pattern recognition more effectively than software running on CPUs.

GPU instances

基于GPU的实例为访问具有数千个计算核心的NVIDIA GPU提供了接口。您可以通过利用CUDA或Open Computing Language(OpenCL)并行计算框架来加速科学、工程和技术渲染应用。此外,它们还可以用于图形应用领域,包括游戏流媒体、三维应用流媒体以及其他类型的图形工作负载。

Instances with AWS Inferentia

The instances are engineered to enhance machine learning capabilities through the use of the AWS Inferentia chip. This specialized AI/ML chip is designed to deliver superior performance with negligible delay in delivering machine learning inference results. These instances are specifically tailored for deployment of Deep Learning (DL) models across a range of applications, including natural language processing, object detection, classification tasks, content personalization systems, filtering mechanisms, and speech recognition systems.

FPGA instances

FPGA-based instances offer access to massive FPGA devices that feature millions of parallel processing units. Users can leverage FPGA-based accelerated computing instances to process various tasks, including genetic research tasks, financial computations, real-time video encoding/decoding operations, big data analysis, and security-related computations. By utilizing specialized hardware optimizations for these tasks.

Storage Optimized

Storage-optimized instances are tailored for workloads necessitating extremely high consecutive read and write operations on large datasets stored locally. These instances are engineered to sustain hundreds of thousands of ultra-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 provide the ability to scale per instance and are suitable for the following scenarios.

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 are characterized by their high computational demands, including tasks such as MapReduce and distributed file system operations.

Systems which require sequential access to large amounts of data on direct-attached instance storage can be efficiently optimized for performance.

Applications necessitating high-performance data retrieval from massive amounts of information are a focus in modern systems.

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

建议您使用最新的Amazon Linux 2版本或Amazon Linux AMI。
具有NVMe实例存储体积的实例必须使用Linux AMI且内核版本为4.4或更高。
D2实例提供最佳磁盘性能当使用支持持久授权的Linux内核以及Xen块环协议的扩展时。
EBS优化实例通过消除亚马逊EBS I/O与其他网络流量之间的竞争,在您的实例中提供一致的高性能。
一些存储优化实例类型允许您控制Linux中的处理器C状态和P状态。C状态控制核心在 inactive时进入的不同睡眠级别,而P状态控制核心的理想执行频率。

Instance Features

AMI virtualization types

  • The virtualization type of your instance is based on the AMI used for its booting.
  • Currently, all instance types rely exclusively on hardware virtualization.
  • While older generations support paravirtualization, certain AWS regions also offer PV instances.
  • Optimizing performance requires selecting an HVM-based Amazon Machine Image.
  • Additionally, utilizing enhanced networking features within HVM-based Amazon Machine Images is strongly recommended.

Instances built on the Nitro System

  • The Nitro System represents a set of AWS-integrated hardware and software modules designed to offer superior performance, reliable availability, and robust security.
  • The Nitro System offers bare-metal capabilities, effectively eliminating the overhead associated with virtualization while supporting workloads that demand full access to the host’s hardware infrastructure.
  • Bare metal instances are well suited for the following:

Workloads that depend on access to low-level hardware features (such as Intel VT) are not available or fully supported in virtualized environments.

Applications need a dedicated environment for licensing and additional support requirements.

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

a1_metal, c5_metal, c5·metal, c5d_metal, c5n_metal, m5·metal, m5d_metal, m5dn_metal, i3_en_metal

Multiple Storage Options

  • Amazon EBS
  • Amazon EBS is a robust solution for storing data in a block-based manner, allowing it to be attached to a single running Amazon EC2 instance.
  • Amazon EBS volumes are independent of the lifecycle of an Amazon EC2 instance.

You can also generate an AMI image directly from an active EBS volume attached to the instance—while ensuring that the instance is shut down first.

EBS volumes can be

  • Instance stores
  • Instance store volumes consist of SSDs that are directly attached to the server hosting your virtual machine and connected through high-speed NVMe links. These volumes provide efficient data access and offer temporary block-level storage for Amazon EC2 instances.
  • The data stored on an instance store volume exists exclusively while its linked Amazon EC2 instance is active.

The system is ideally suited for temporarily storing changing information such as buffers caches scratch data and other transient content or replicated data spread across multiple instances like a load-balanced pool of web servers.

Data in the instance store is lost when:

  • 当磁盘驱动器出现问题时。
    • 当实例重启时(数据在重启后仍会存在)。
    • 该实例终止运行。
  • 亚马逊S3作为一种高效可靠的对象存储服务。

EBS-optimized Instances

  • EBS-optimized instances are designed to enable EC2 instances to maximally utilize the I/O bandwidth allocated on an EBS volume by decoupling Amazon EBS I/O traffic from other network activities on the instance, ensuring optimal performance for your EBS volumes.
  • EBS-optimized instances are engineered to provide dedicated I/O throughput between Amazon EC2 and Amazon EBS, minimizing interference and enhancing efficiency.
  • We strongly advise utilizing either provisioned IOPS volumes paired with EBS-optimized instances or EC2 instances supporting cluster networking for applications requiring high storage I/O capabilities.

Provisioned IOPS—which in some contexts is referred to as EBS Optimized

Cluster Networking

  • A cluster placement group 实现了所有实例间的低延迟通信。
  • 当部署在放置组时,在单流量情况下最多支持10Gbps,在多流量情况下最多支持100Gbps。I/O至互联网的总带宽被限制在5Gbps。
  • 集群网络非常适合用于高性能分析系统以及众多科学与工程应用领域,并特别适用于使用 MPI 标准库支持的并行编程应用。

Enhanced Networking

For workloads requiring greater network performance

Improved network capabilities mitigate the effects of virtualization on network performance through enabling a feature known as Single Root I/O Virtualization (SR-IOV). This leads to higher packet throughput, reduced latency, and minimized jitter.

Enhanced networking services are exclusively provided to instances launched in the Amazon VPC.

Various instances employ a network I/O credit-based allocation system, distributing network bandwidth among instances proportionally according to their average usage levels. Credit accumulation occurs when an instance’s current bandwidth falls short of its baseline threshold. Once accumulated, these credits enable the instance to execute high-bandwidth data transfer operations.

Change the instance type

When your instance's root device is a primary EBS volume, you can adjust the instance size by altering its instance type setting.

it is imperative that if the root device for your instance is an instance store volume, you redesign or restructure your application using the appropriate instance type required.

You are required to choose an instance type category that aligns with the configuration of the current instance. If and only if the desired instance type does not align with your existing configuration, you are required to migrate your application to a new instance of the needed category.

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/?where ec2 whats new is sorted by item additional fields posted date in descending order

AWS Certified Solutions Architect Official Study Guide - Associate

AWS Certified Solutions Architect Study Guide- Associate 2nd Edition

全部评论 (0)

还没有任何评论哟~