Which Amazon EC2 Instance Type is Right for You?

Which Amazon EC2 Instance Type is Right for You? - Shikisoft Blog

Amazon EC2 instances allow you to create your own virtual servers on the cloud, freeing you from the burden of maintaining your own physical architecture. EC2 provides various instance type choices to host your applications. However, having more choices may sometimes confuse you, and you may feel overwhelmed when choosing the optimal one. So, let me help you by simplifying EC2 instance types in this post.

What is an EC2 instance type?

When creating an EC2 instance, you choose an instance type that determines the hardware characteristics of the physical host server on which it will be placed. The instance type also specifies its size and how much you will pay per minute when it is running.

You may see weird characters in instance types, but each has a purpose. The instance type naming follows a specific pattern. First comes the instance family part, which is followed by the instance size after a dot.

EC2 instance type format - Shikisoft Blog
  • The instance family begins with the series. The series is the most critical part of the instance type because it specifies the main characteristics.

  • The series is followed by the generation number of the series. Over time, AWS upgrades physical host servers and releases new generations.

  • Next comes the options part of the generation, which includes a few optional letters or words. These options may represent the CPU architecture of the instance family, such as g for Graviton, i for Intel, or a for AMD. An instance type may also include other options, such as n for Network and EBS optimized or d for those providing instance-store storage. These are the current options:

    • a – AMD processors
    • g – AWS Graviton processors
    • i – Intel processors
    • b – Block storage optimization
    • d – Instance store volumes
    • e – Extra storage or memory
    • flex – Flex instance
    • n – Network and EBS optimized
    • q – Qualcomm inference accelerators
    • z – High CPU frequency
EC2 instance family format - Shikisoft Blog

The size part after the dot (.) is simple: nano, micro, small, medium, large, xlarge, 2xlarge, etc. It goes on as powers of 2. It determines how much resources will be allocated to the instance. Therefore, together with the instance family, the size finalizes the instance’s cost per minute.

EC2 instance size format - Shikisoft Blog

Amazon EC2 provides various instance types with distinct advantages and use cases. The instance families are also grouped into categories. Now, let’s discuss them one by one. I also added some keywords in parenthesis to help you remember the purpose of each instance series.

General Purpose Instance Types

This category offers instance types with balanced memory, compute, and networking resources. They are feasible if your application uses these resources equally, such as web servers.

M Instances (Medium)

The M series instances are in this category, which provides consistent performance and is ideal and cost-effective if you know the expected load on your application most of the time.

T Instances (Threshold)

The other option is the T-series, which are burstable instances. These instances normally operate at a baseline performance (threshold), such as 20%, and accumulate CPU credits when the load is below the baseline. They use these credits to burst to 100% CPU capacity if the load becomes high later. Hence, they are cost-effective when you don’t know your apps’ load characteristics yet or if your app’s load is mostly low. But don’t expect consistent CPU performance as in M instances because they always operate at 100% CPU capacity.

Currently, t4g.micro, t3.micro, and t2.micro instances provide AWS free-tier benefits with 750 hours/month cumulatively. So, I mostly use these instance types during hands-on examples in my courses.

Mac Instances (Mac)

Mac instances are also in this category. They provide on-demand macOS instances on the cloud. So, if you are developing apps for the Apple ecosystem, such as iPhone, Mac, or Apple TV, you can use these instances to develop, build, and test your apps.

Compute-optimized Instance Types

The second category is the compute-optimized instances. They offer high-performance processors for compute-intensive applications. The C-series instances belong to this category.

C Instances (Compute or CPU)

The instances in this series have more virtual CPU cores per GB of memory. They can be used for media transcoding, high-performance web servers, high-performance computing (HPC), scientific computing, batch processing, machine learning inference, and anything else that requires high-performance CPUs.

Memory-optimized Instance Types

Next, you have memory-optimized instance types. The instance types in this category provide fast performance for memory-intensive applications that process large data sets in memory.

There are multiple instance series in this category.

R Instances (RAM)

The R-series instances are designed for standard memory-intensive applications, such as open-source relational databases like MySQL, in-memory caches like Redis, or real-time big data analytics.

X Instances (Extra RAM)

The X-series provides more memory capacity than its R-series counterparts in the same sizes with similar use cases that require more memory.

U Instances (Ultra Large)

U-series instances are designed for large enterprise databases, such as SAP HANA. They are huge and have very high memory and processor capacity.

Z Instances (Z - A sign for High-frequency)

The Z-series is new and offers both high-frequency compute and high memory capacity. It also provides large instance store capacity to increase performance.

Accelerated Computing Instance Types

In accelerated computing, you offload some tasks to specialized hardware accelerators, often GPUs and other co-processors, to speed up processing with parallelization. For example, suppose your app performs graphics processing, data pattern matching, or scientific floating point number calculation. In that case, using a hardware accelerator is more efficient than relying on a standard CPU. So, the instances in this family offer hardware accelerators or co-processors in addition to virtual CPUs.

They are ideal for deep learning and generative AI applications like

  • code generation,
  • speech recognition,
  • video and image generation,
  • high-performance computing (HPC) applications such as
    • computational fluid dynamics,
    • weather forecasting,
    • computational finance,
  • graphics processing like
    • real-time rendering,
    • cinematic-quality graphics,
    • game streaming, etc.

Yes, all these require specialized hardware.

G Instances (GPU)

The first members of this category are G-series instances. They are GPU-based instances with Nvidia GPUs for standard machine learning and high-performance needs.

P Instances (Power)

The P-series instances also have Nvidia GPUs. They provide more GPUs and GPU memory than G-based instances, so they are for applications that demand more GPU capacity.

Trn Instances (Trainium)

The Trn-series instances contain AWS’s Trainium chips as hardware accelerators, which are designed for high-performance machine learning training and inference workloads.

Inf Instances (Inferentia)

Another instance series with purpose-built chips is the Inf series. These instances contain AWS’s Inferentia chips specially designed for deploying deep learning and generative AI inference workloads.

DL Instances (Deep Learning)

The DL series is dedicated to deep learning and contains Gaudi accelerators from Habana Labs or Qualcomm AI 100 accelerators.

F Instances (FPGAs)

The F-series instances have field-programmable gate arrays (FPGAs), which are suitable for genetics research, financial analytics, real-time video processing, etc.

VT Instances (Video Transcoding)

The VT series instances are designed for video transcoding needs such as broadcasting live events and video conferencing.

Storage-optimized Instance Types

The next category is storage-optimized instances. These are feasible if your workloads perform high, sequential read/write operations to large data sets in local storage or perform tens of thousands of low-latency, random input-output operations per second (IOPS).

These two access patterns require different types of storage: solid-state drives (SSDs) and hard disk drives (HDDs).

I Instances (IOPS)

The I-series instances have solid-state drive (SSD) disks with high input-output (IO) performance because they are designed for workloads that require real-time, random, and low-latency access.

These applications frequently access random parts of storage, but they return relatively smaller data chunks than others. They are ideal for workloads such as relational and No-SQL databases, real-time databases, and real-time analytics engines.

D Instances (Dense)

On the other hand, the D series instances offer high performance for sequential, not random, input-output operations and high disk throughput. They have hard disk drives (HDDs) instead of SSDs, providing better performance and lower costs for those needs.

You can use them for distributed file systems such as MapReduce File Systems, massively parallel data warehouses such as Redshift, big data analytics workloads such as Spark or Hadoop, or data processing apps such as Kafka or Elasticsearch.

H Instances (Hard Disk - HDD)

Alternatively, you can opt for H-series instances if you need instances with HDD disks that balance CPU and memory. They have less memory per CPU than D-series instances but are cheaper.

HPC Instance Types (HPC)

Lastly, there is the HPC-optimized category. These instances are designed to provide the best price-performance ratio for high-performance computing needs. This category has only a single instance series with the same name.

HPC Instances

The HPC-series instances are in this category. They don’t have hardware accelerators or co-processors; they only have high-performance CPUs. They are cost-effective and feasible for HPC applications with moderate needs, such as weather forecasting or molecular dynamics.

Conclusion

Amazon EC2 provides various instance types for different use cases and budgets. For example, you can use compute-optimized, accelerated computing, or HPC instances for high-performance computing. Each provides a different price per performance. So, it all depends on your application’s type and how much you are willing to spend. Solutions architecting is about choosing the optimal solution that aligns with your budget and needs. I hope this post will be helpful as a summary of EC2 instance types.

By the way, the contents of this blog and the screenshots are from my incoming course on AWS Certified Cloud Practitioner certification. It will help you learn AWS basics while earning a crucial certificate. Follow me on LinkedIn and X.com (formerly Twitter) to know when it is ready.

Thanks for reading, and see you in our next post!

References

Which Amazon EC2 Instance Type is Right for You? - Shikisoft Blog
Emre Yilmaz

AWS Consultant • Instructor • Founder @ Shikisoft

Follow