August 23, 2023 By Christopher Graham 7 min read

When it comes to hosting applications on Amazon Web Services (AWS), one of the most important decisions you will need to make is which Amazon Elastic Compute Cloud (EC2) instance type to choose. EC2 instances are virtual machines that allow you to run your applications on AWS. They come in various sizes and configurations—known as instance families—each designed for a specific purpose. Choosing the right instance offering and instance size for your application is critical for optimizing performance and reducing costs. However, as the demand profile of every application is unique—and can change over time—this task is much easier stated than solved. The 2xlarge instance of a given family may not be necessary, but when application teams task cloud operations with maintaining uptime, the larger, costlier instance size becomes attractive—that is, until cloud bills balloon.

In this blog post, we will explore the challenges of selecting the best Amazon EC2 instance type for your application and provide you with some best practices for how to make the right decision. Additionally, we’ll explain how a solution like IBM Turbonomic can help rightsize your AWS cloud apps using machine learning, auto-scaling, and automation. If you are familiar with Turbonomic and wish to start optimizing your AWS environment now, start your free 30-day trial today.

Understanding Amazon EC2 Instance Types

EC2 instances are classified based on their characteristics such as CPU, memory, storage, and networking capacity. Each instance type is designed to optimize for specific workloads such as general-purpose computing, memory-intensive applications, or compute-intensive tasks. Here are some examples of EC2 instance types and their primary use cases:

  • General Purpose Instances (A, T, M, and C series): General-purpose instance types are designed for a variety of workloads, including web servers, small databases, and development and testing environments. This group includes the m5 instance, the latest generation of General Purpose Instances powered by Intel Xeon® Platinum 8175M or 8259CL processors. These instances provide a balance of compute, memory, and network resources, and is a good choice for many applications.
  • Compute Optimized Instances (C and R series): These instances are optimized for compute-intensive workloads such as high-performance computing, batch processing, and scientific modeling. These instances maximize compute power using GPU and high core count CPU.
  • Memory Optimized Instances (X, Z, and R series): These high memory instances are optimized for memory-intensive workloads such as high-performance databases, distributed in-memory caches, and real-time data processing/big data analytics.
  • Storage Optimized Instances (I, D, and H series): These instances are optimized for storage-intensive workloads such as big data, data warehousing, and log processing. They leverage high capacity caching and solid state drives (SSD) to support the intense read and write activities of the workloads.

Challenges in Choosing the Right EC2 Instance Type

Choosing the right EC2 instance type for your application can be a daunting task. Here are some of the challenges you may face:

  • Complexity: With so many instance offerings to choose from, it can be challenging to determine which one is the best fit for your application. Additionally, Amazon consistently introduces new instance types to its service catalogue, implying that the best fit for your application today may not necessarily be the best fit for your application several months from now.
    • How Turbonomic helps: Turbonomic continuously ingests the specifications of the entire AWS service catalogue and maps the resource consumption profile of your workloads—both their baseline and percentiles-based peaks—to the best fit instance type.
  • Workload Type: What type of workload will your application be running? Is it a compute-intensive workload, or does it require a lot of memory or storage capacity? Once you have a clear understanding of your workload, you can narrow down your options to instance types that are optimized for your workload.
  • Performance Requirements: Do you need a high-performance instance type to handle large workloads or a smaller instance type to handle light workloads? Does the workload support a customer-facing, low-latency application, or an internal administrative application? What data locality requirements will you need to abide? Keep in mind that the performance of an instance type can vary depending on the region and the usage pattern of your application.
    • How Turbonomic helps: Determining workload type across an entire hosting environment is a significant task, but made easy with the help of cloud cost optimization software. Turbonomic automatically detects the current and historical utilization of your workloads’ vCPU, memory, storage access (IOPS), net throughput, I/O throughput, storage amount, reserved instance coverage, database vMemory, database vCPU, database storage amount, database I/O throughput, RI inventory, and RI coverage—and determines the best instance family and instance type to support the workload.
  • Scalability: You need to ensure that the instance type you choose can scale up or down as needed to handle changes in traffic and workload. Furthermore, you need to know how the applications each EC2 instance will host are designed to scale. If the application is composed of microservices, scalability and performance requirements must be considered together.
    • How Turbonomic helps: Depending on how each application is designed to scale, Turbonomic can drive the most economic scale up / scale down actions available, as well as ensure scale out / scale in actions are conducted in the most cost-effective manner possible.
  • Cost: Cost is among the most important considerations and challenges when choosing an EC2 instance type. You need to consider the hourly cost of the instance type, as well as any additional charges for data transfer, storage, and other AWS services. Additionally, the various pricing models including reserved instances and savings plans (explained in this blog post) add to the complexity of the cost calculation.
    • How Turbonomic helps: Turbonomic is designed to assure the performance of your applications at the lowest possible cost. You can start a free 30-day trial today and see results in as little as 30 minutes!

Best Practices for Choosing the Best EC2 Instance Type

Now that you understand the most common challenges of choosing the best EC2 instance, here are some of the best practices we encourage our clients and partners to follow.

1.    Understand Your Workload

The first and most important step in selecting the right EC2 instance type is to understand your workload. Every application has different requirements in terms of CPU, memory, network, and storage, and it is essential to know what your application needs to run smoothly.

For example, if you are running a database application, you may need a large amount of RAM to handle queries efficiently. On the other hand, if you are running a compute-intensive application, you may need a high-performance CPU.

To get a better understanding of your workload, you can use tools like AWS CloudWatch or third-party monitoring solutions to gather data on resource utilization. This data can then be used to determine the optimal instance type for your application.

2.    Consider the CPU

The CPU is one of the most critical components of an EC2 instance, as it determines the instance’s processing power. If your application requires high CPU performance, you should look for an instance type that has a higher CPU count and clock speed.

AWS offers a variety of CPU-optimized instance types, such as the C5, M5, and R5 families, that are designed for high-performance computing workloads. These instances feature the latest generation custom-built AWS Graviton3 processors (significant upgrades to the Graviton2) and are optimized for applications that require high CPU utilization. However, if your application does not require high CPU performance, you can opt for a cheaper instance type with no GPU and a lower CPU count, such as the T3 family.

3.    Consider the Memory

Memory is another critical component of an EC2 instance, as it determines how much data the instance can process at a time. If your application requires a lot of memory, you should look for an instance type that has a larger memory capacity.

However, if your application does not require a lot of memory, you can opt for a cheaper instance type that has a smaller memory capacity, such as the T3 family.

AWS offers a variety of memory-optimized instance types, such as the X1, R4, and z1d families, that are designed for memory-intensive workloads. These instances feature large amounts of memory and are optimized for applications that require high memory utilization, such as in-memory databases.

However, if your application does not require a lot of memory, you can opt for a cheaper instance type that has a smaller memory capacity, such as the T3 family.

4.    Consider the Network

The network is another critical component of an EC2 instance, as it determines how fast data can be transferred to and from the instance. If your application requires high network performance, you should look for an instance type that has a higher network bandwidth.

AWS offers a variety of network-optimized instance types, such as the C5n and the high-performance compute HPC families, that are designed for network-intensive workloads. These instances feature high-speed network interfaces and are optimized for applications that require high network utilization.

However, if your application does not require high network performance, you can opt for a cheaper instance type that has a lower network bandwidth, such as the T3 family.

5. Consider the Storage

Storage is the final critical component of an EC2 instance, as it determines how much data can be stored on the instance. If your application requires a lot of storage, you should look for an instance type that has a larger storage capacity (Elastic Block Store, or EBS). However, proceed with caution—storage is also among the most costly cloud resources and can easily generate unnecessary spend through idle and unattached EBS volumes.

AWS offers a variety of storage-optimized instance types, such as the I3 and D2 families, that are designed for storage-intensive workloads. These instances feature large amounts of SSD storage and local storage and are optimized for applications that require high IOPS throughput.

However, if your application does not require a lot of storage, you can opt for a cheaper instance type that has a smaller HDD-based storage capacity, such as the T3 family.

6. Consider the Pricing Model

AWS offers several pricing models for EC2 instances, including On-Demand, Reserved Instances, and Spot Instances. Each model has its own advantages and disadvantages, and it is essential to choose the one that best fits your workload and budget.

On-Demand instances are priced by the hour and do not require any upfront commitment. They are best suited for workloads that have variable demand or short-term projects.

Reserved Instances provide a significant discount on the hourly rate in exchange for a one-time upfront payment. They are best suited for workloads that have predictable usage and require long-term commitment.

Spot Instances allow you to bid on unused EC2 capacity and can provide significant cost savings. However, they are best suited for workloads that can handle interruptions and have flexible start and end times.

For a deep dive on AWS pricing models and how you can capitalize on them, read our blog Managing AWS EC2 Pricing and Usage with IBM Turbonomic.

7.    Test and Optimize

Once you have selected an EC2 instance type, it is essential to test and optimize your application to ensure that it is running efficiently. You can use tools like AWS CloudWatch or IBM Instana to monitor your application’s performance and identify any bottlenecks or areas for improvement.

Conclusion

Selecting the right EC2 instance type is crucial for the performance and cost-effectiveness of your AWS infrastructure. By understanding your workload, considering the CPU, memory, network, and storage requirements, choosing the right pricing model, and testing and optimizing your application, you can ensure that you are getting the most out of your EC2 instances. 

Remember that selecting the best instance type is not a one-time decision, as your workload and infrastructure needs can change over time. Continuously evaluating and optimizing your EC2 instance types can help you achieve optimal performance and cost-effectiveness for your AWS infrastructure.

IBM Turbonomic can help you manage this process automatically by continuously assessing your AWS applications’ resource requirements and generating specific actions that save money and keep your EC2 instances right-sized. Turbonomic uses machine learning and automation, easily integrating with your AWS and AWS Billing accounts and generates optimization actions within 30 minutes.

Start your free 30-day trial today
Was this article helpful?
YesNo

More from Automation

Deployable architecture on IBM Cloud: Simplifying system deployment

3 min read - Deployable architecture (DA) refers to a specific design pattern or approach that allows an application or system to be easily deployed and managed across various environments. A deployable architecture involves components, modules and dependencies in a way that allows for seamless deployment and makes it easy for developers and operations teams to quickly deploy new features and updates to the system, without requiring extensive manual intervention. There are several key characteristics of a deployable architecture, which include: Automation: Deployable architecture…

Understanding glue records and Dedicated DNS

3 min read - Domain name system (DNS) resolution is an iterative process where a recursive resolver attempts to look up a domain name using a hierarchical resolution chain. First, the recursive resolver queries the root (.), which provides the nameservers for the top-level domain(TLD), e.g.com. Next, it queries the TLD nameservers, which provide the domain’s authoritative nameservers. Finally, the recursive resolver  queries those authoritative nameservers.   In many cases, we see domains delegated to nameservers inside their own domain, for instance, “example.com.” is delegated…

Using dig +trace to understand DNS resolution from start to finish

2 min read - The dig command is a powerful tool for troubleshooting queries and responses received from the Domain Name Service (DNS). It is installed by default on many operating systems, including Linux® and Mac OS X. It can be installed on Microsoft Windows as part of Cygwin.  One of the many things dig can do is to perform recursive DNS resolution and display all of the steps that it took in your terminal. This is extremely useful for understanding not only how the DNS…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters