AWS EC2 Instances: Choose Your EC2 Family Wisely

AWS EC2 Instances: Choose Your EC2 Family Wisely

When choosing an EC2 instance family, it can be tempting to select a general-purpose family. Instead, it is worthwhile exploring the different types available based on what best fits your particular requirements. After all, the choice of EC2 instance family has a direct impact on the cost and performance of your application.

It is all too easy to end up in a situation where an application is no longer using the best fit EC2 instance for its needs. For instance, imagine a scenario in which an organization decides to deploy a new application on AWS. The team selects t2 instances because there is relatively little traffic. A few months pass and the application starts getting more requests and some new features are introduced. Without changing the EC2 instance type the organization continues with t2 instances and now they are facing some application performance issues. Given the application requirements evolved, t2 is no longer the optimal EC2 instance type since it is generally used for burstable workloads only. What the organizations should have done is evaluate the different EC2 instance families, considered the newly introduced application modules, and examined which kind of resources they require (memory/CPU) before introducing the application into a production environment.

Or, to pick another example, imagine a scenario where the cloud operation team is asked by the CTO to deploy an application downstream database in a clustered set-up.  Initially, the team deploys a database cluster in two M5 instances and finds that cluster metrics are showing replication lags (latency). The team identifies a need for more memory and better network throughput. In this scenario, we recommend using R5n instances because they have 25 – 100 Gb bandwidth and memory optimized.

In this blog, we will explore the different factors the influence EC2 instance family selection, how to identify the EC2 instance types by their alpha-numeric characters, which processors and hypervisors go with the different EC2 instances. Finally, we will cover what use cases are most often associated with which EC2 instance family.

Key Considerations

When choosing an AWS EC2 instance, there are several key considerations that need to be factored in. These include:

  • Best practicesIncluding AWS and application specific best practices (e.g. SAP HANA or any other application framework)
  • Workload – Environment specific workload and instance selection like Dev, QA & Prod. Some instance type like t2 and t3 are not for the heavy workload production environment.
  • Cost – Evaluate the price of instance according to need, use current generation instance types which are more cost effective then older generation.
  • Application needs – What does your application use a lot of? CPU, Memory, IO, network or GPU? Evaluate what kind of application you are going to deploy on EC2.

Available EC2 Instances

A1 T3 T3a T2 M6g M5 M5a M5n M4

C5 C5n C4

R5 R5a R5n R4 X1e X1 z1d u-*tb1.metal

P3 P2 Inf1 G4 G3 F1

I3 I3en D2 H1

Demystifying EC2 Instance Types

Family: High level usage identifier initial.

Generation: Version of type, which means latest generation of the instance.

Size: Compute, memory, GPU or resource proposition.

Identifying Instances by Initials

C – Compute optimized

D – Storage optimized local HDD disk throughput and volume

G – Accelerated computing graphic intensive GPU

H – Storage optimized local HDD based local storage and balanced CPU/memory

I – Storage optimized high IOPS SSD, low latency and sequential read

M – General purpose

P – Accelerated computing general purpose GPU

F – Accelerated FPGA compute

R – Memory optimized, require high memory

T – General purpose burstable instance (credits)

X – Memory optimized large scale in-memory database – HA and HP database

Z – Memory optimized with all core frequency of up to 4.0 GHz.

Understanding Detailed Usage

Using the following example of an instance type, m5d.xlarge, what is “d“?

  • d – Local NVMe-based SSDs are physically connected to the host server
  • en – Dense SSD storage with NVMe SSD and good network
  • Inf – Machine learning inference applications – AWS Inferentia chips
  • a – AMD EPYC Processor
  • n – Improved network throughput and packet rate performance 25 – 100 Gbps
  • g – Graviton2 Processor AWS developed
  • e – Highest memory with lowest price per GiB
  • metal – Bare metal instances (yes, it is bare metal).

Processors Used by EC2 Instances

AWS EC2 instances are backed with

  • Intel® Xeon® and AMD EPYC
  • AWS Graviton Processor

AWS Graviton (AL73400)

The AWS Graviton (AL73400) – AWS re:Invent 2018

CPU: 16x ARM Cortex-A72 @ up to 2.3 GHz

Memory: Up to 32GB

Network Bandwidth: Up to 10 Gbit/s

EBS Bandwidth: Up to 3.5 Gbit/s

AWS Deployment: Amazon EC2 A1 instances

AWS Graviton2

The AWS Graviton2 – AWS re:Invent 2019

CPU: 64x Arm Neoverse N1 @ up to 2.5 GHz

Memory: Up to 512GB

Enhanced Network Bandwidth: Up to 25 Gbit/s

EBS Bandwidth: Up to 18.5 Gbit/s

AWS Deployment: Amazon 6th generation M6g (R6g & C6g) instances

Hypervisor Behind EC2 Instance

All the old generation EC2 instances use Xen, and the majority of new instance types use AWS Nitro System.

AWS Nitro System

  • A combination of dedicated hardware and lightweight hypervisor
  • Enabling faster innovation and enhanced security
  • .metal instances
  • Better performance and price
  • Nitro cards and security chip with Nitro hypervisor – EBS (io1) Multi-Attach

It is built on core Linux Kernel-based Virtual Machine (KVM) technology but does not include network and storage as operating system components. This hypervisor is typically used to manage the deployment of compute and memory resources.

EBS IO1 Multi attach – We can attach one EBS io1 volume to 16 EC2 instance within single AZ.

Which EC2 Instance Do I Need?

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

Use Case

  • Scale-out workloads such as web application servers, containerized microservices, caching fleets, small to medium development environments.
  • Low-latency user interactive applications, small to medium databases workload, virtual desktops machines, code repositories, application servers.
  • Websites, build servers, API micro services, test and staging environments, and M5 and M6 can be used for business applications.
  • Tasks that require additional memory and for running backend servers for SAP, Microsoft SharePoint, cluster of other enterprise applications.
  • Small to medium cluster of databases and API services.

Compute OptimizedC5 c5d C5n C4

Use Case

  • High performance web servers, scientific modelling, batch processing, distributed analytics.
  • High-performance computing (HPC), machine/deep learning inference, highly scalable multiplayer gaming platform apps, and video encoding and decoding.
  • High performance front-end fleets and backend application and API servers.
  • Science and engineering applications, ad serving, gaming streamer and engine server with high performance from the CPU.

Memory OptimizedR5 R5a R5n R4 X1e X1 z1d u-*tb1.metal

Use Case

  • High performance databases cluster, distributed web scale in-memory caches, mid-size in-memory databases, and other enterprise applications.
  • Data mining and analysis, applications performing real-time processing of unstructured big data and Hadoop/Spark clusters and high-performance computing (HPC).
  • In-memory databases (e.g. SAP HANA). x1e.32xlarge instance certified by SAP to run next-generation Business Suite S/4HANA, Business Suite on HANA (SoH), Business Warehouse on HANA (BW), and Data Mart Solutions on HANA on the AWS cloud.
  • Metal instances are deal for large enterprise databases, electronic design automation and certain relational database workloads with high per-core licensing costs.

Accelerated ComputingP3 P2 Inf1 G4 G3 F1

Use Case

  • Machine/deep learning, high performance computing, computational fluid dynamics, computational finance, seismic analysis, speech recognition, autonomous vehicles, drug discovery.
  • Molecular modelling, genomics, rendering, and other server-side GPU compute workloads.
  • Recommendation engines, forecasting, image and video analysis, advanced text analytics, document analysis, voice, conversational agents, translation, transcription, and fraud detection.
  • Machine learning inference for applications like adding metadata to an image, object detection, and language translation. Video transcoding, photo-realistic design, and game streaming in the cloud.
  • 3D visualizations, graphics-intensive remote workstation and 3D rendering. Genomics research, financial analytics and real-time video processing.

Storage OptimizedI3 I3en D2 H1

Use Case

  • NoSQL databases (e.g. Cassandra, MongoDB, Redis), in-memory databases (e.g. SAP HANA, Aerospike)
  • Scale-out transactional databases cluster, distributed file systems such as HDFS and MapR-FS, data warehousing, Elasticsearch, analytics workloads.
  • Massively Parallel Processing (MPP), MapReduce and Hadoop distributed computing, network file systems, log or data-processing applications.
  • Compute and memory balanced workload with HDD-based physical local storage. Apache Kafka, and big data workload clusters.

Pause and Resume Instances

AWS now allows teams to pause instances without losing your settings. This is called hibernation. Instances that are backed with AWS Nitro can be hibernated, which means the memory data is saved into the root volume of the EC2 instance. When you re-start the instance, it will collect the data from root volume to memory and serve you immediately.

You can learn more about instance types here, or alternatively to discuss the specific digital challenge you’re facing, get in touch with Infostretch using the form below.

Interested in our Cloud Services?

+1 408-727-1100

By submitting this form, you agree that you have read and understand Infostretch’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

By submitting this form, you agree that you have read and understand Infostretch’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.