AWS Step-by-Step

EC2 Instance Type, Part 1: Choosing the Right One

In this first part, let's break down the instance types that are available to you.

One of the most important decisions that you will have to make when creating a new EC2 instance is that of choosing the optimal instance type. The instance type is what determines the hardware resources that will be allocated to an instance. Selecting too small of an instance type will result in poor performance, or even an inability for the virtual machine to run its required workload. Conversely, choosing an instance type that is too large might improve performance, but it will also increase the virtual machine's cost.

The good news is that while it is important to choose the optimal instance type, choosing correctly is not necessarily a make or break decision. If after deploying an instance you realize that you should have used a different instance type, you can pick a new one. Even so, it's best to try to pick the right instance type on the first try so that you can avoid excessive costs or service disruptions (while switching to a different instance type) later on.

So how can you figure out which instance type to pick? In Microsoft Azure, there is an option to show only the recommended sizes based on the operating system that you are deploying. Unfortunately, Amazon does not offer this type of option. Having said that however, there is a brand new feature can make it easier to determine which instance size you should be using. I will talk about this new feature in Part 2.

Initially, the most important thing to know about instance types is that they are grouped into categories. As such, one of the best practices for choosing the optimal instance type is to begin by choosing the category that most closely aligns to your anticipated workload.

Unfortunately, AWS does not make it super obvious how the various instance types vary from one another. Instance types are generally listed with a code, followed by a size. For example, some of the available instance types include m7G.Medium, t2.micro. and a1.xlarge.

It's pretty obvious that an xlarge instance is going to have more hardware resources associated with it than a small or a micro image will, but there are dozens of instance sizes to choose from and any number of them could be listed as being medium sized, or large sized, or whatever.

When you are selecting an instance size, you aren't forced to rely solely on the instance name for guidance. Amazon also tells you the architecture, the number of virtual CPUs and the amount of RAM that is associated with each instance type. Having this information can help you to make an intelligent choice. Even so, it can be helpful to understand Amazon's naming conventions.

General Purpose Instances
Instances with a name starting with the letter M (such as M7G) or the letter T (such as T2 or T3) are categorized as being general purpose in nature. These instances sizes are suitable for most workloads, so long as you choose a large enough size.

The most important thing to understand about general purpose instance sizes is that their hardware resources are balanced. In other words, the compute, network, and memory resources are allocated in a way that makes them all proportional to one another.

Compute Optimized Instances
The next instance type to be aware of is the compute optimized instance. Compute optimized instances start with the letter C (C7G, C4, etc.). What makes them different from general purpose instances is that compute optimized instances tend to be CPU heavy and are designed for running CPU intensive tasks.

Memory Optimized
Memory optimized instances start with either the letter R (R8G, R7i, etc.) or the letter X (X1, X2idn, etc.), There is also one memory optimized option that starts with the letter Z (Z1D). These instance types are designed for use with compute intensive workloads that handle large, in memory datasets.

Accelerated Computing
Accelerated Computing instances use a variety of different codes. Instance types that start with the letters P or G are accelerated computing instances. However, there are also a few other codes including Trn1, DL1, DL2Q, F1, VT1, and anything starting with INF. Accelerated computing instances are designed for running CPU intensive workloads that need the additional processing power provided by a coprocessor or GPU. These instances are well suited to running AI related workloads or graphically intensive applications.

Storage Optimized
Storage optimized instances usually start with the letter I (I4G, Is4Gen, etc.) However, D2, D3, D3en, and H1 instances are also storage optimized. These instances are intended for use with workloads that require a high number of random storage IOPS. Some storage optimized instances are also geared toward those who need high capacity storage without sacrificing performance.

HPC Optimized
The last instance type is HPC optimized. HPC optimized instances always start with the letters HPC. These instances are designed for running HPC workloads at scale.

Understanding the codes that Amazon uses for its instance types can go a long way toward helping you to choose an appropriate instance type for your workload. However, Amazon has recently released a new tool that makes the process of selecting an instance size easier than it has been in the past. I will tell you about this new tool in Part 2.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.


Subscribe on YouTube