In this second and final part of the series, we will give an overview of EC2 instance types along with their specifications and features. We will also look at some use cases for which each instance is best-suited.
You may have a high-performance database in your data center you are migrating to AWS, and are trying to find the best instance for the job. Or, you are deploying a memory-intensive application and, while there are various options you can choose from, price is the limiting factor for you.
Overview of EC2 Instance Types
As we know, there are five categories under which all instances are grouped, each focusing on different types of workload. Each EC2 instance type also comes with its own combination of resources and is available in different sizes, allowing it to be used in many different ways when architecting your infrastructure.
General purpose instances are optimally balanced and used for various workloads. T2 is the lowest cost general purpose instance, best used for workloads that do not need full consistent compute capacity, but do require occasional bursting. This is achieved by accumulating CPU credits when the instance is idle, and spending them when needed. It is great for development environments, lightweight web-servers/applications, and smaller databases.
M4 is the latest addition to general purpose instances and is a good choice for small to mid-size databases, data processing, and various backend servers for enterprise applications. It is EBS-optimized by default and supports enhanced networking (used when higher bandwidth or lower latency between instances is needed). These two EC2 instance types are similarly priced, but compared to T2, M4 is a better choice when you have stable and predictable workloads.
Compute optimized instances are used for CPU-intensive workloads and have the lowest cost per CPU with the highest CPU-memory ratio of all instances. They are well-suited for high-traffic web servers, on-demand batch processing, video encoding, and gaming servers. C4 is the latest generation instance and offers the highest performing processor (Intel Xeon E5-2666), supports clustering and enhanced networking, and is EBS-optimized by default.
If you choose c4.8xlarge, it will give the capacity to control processor C-state and P-state on Linux. C-states are able to control the sleep levels that a core can enter when idle, and P-states controls the preferred performance of a core.
These EC2 instances are designed for applications that do in-memory processing of very large datasets. R4 is the cheaper option and is good for high-performance databases (both relational and NoSQL), real-time data processing (Hadoop clusters), and in-memory key-value stores (Redis and Memcached).
If R4 can’t provide the power you need, X1 instance comes with a minimum of 976 of DDR4-based instance memory (costing a whopping $6.669 per hour) and can go as high as 3,904 GiB if you choose x1.e32xlarge. These exorbitant examples offer the best value per GiB of memory. They are suitable for in-memory databases (SAP HANA) plus big-data processing engines (Apache Spark).
Instances for accelerated computing offer either Graphics Processing Units with thousands of cores or Field Programmable Gate Arrays with millions of parallel system logic cells, both allowing very high processing capabilities. P2 provides NVIDIA Tesla K80 (based on the Kepler architecture) and is used for general-purpose GPU-computing applications utilizing CUDA or OpenCL models. It is great for high-performance databases and machine learning. G3 uses NVIDIA Tesla M60 based on the newer Maxwell architecture, making them slightly faster than P2. They are excellent for graphics applications that utilize DirectX or OpenGL for application streaming, video encoding, and 3D rendering. Unlike the other two, F1 utilizes FPGA for computationally intensive algorithms and is specialized for security, genomics research and big data analytics.
Storage optimized EC2 instance types are designed for applications that require a lot of IOPS, by allowing very high sequential read/write access to local storage. D2 type uses HDDs to achieve high throughput (up to 3,500 MB/s read and 3,100 MB/s write) and offers up to 48TB of local storage at the lowest per-disk throughput cost. It is mostly used for log processing applications and as distributed file systems.
I3 is the newest generation instance which uses NVMe SSD storage and offers up to 3.3 million IOPS at a 4 KB block and up to 16 GB/second of sequential throughput. Unlike D2, it is limited to 15.2 TB of locally attached storage, but with its IOPS-intensive capabilitie, it is the best choice for NoSQL (MongoDB, Cassandra) and in-memory (Redis) databases.
Choosing EC2 instance types
Businesses today have very diverse requirements for their IT infrastructure, whether it’s the raw CPU/memory power, or IOPS for those with storage-oriented needs. Also, some applications are utilized consistently while others only occasionally, so it’s not only about the amount of resources being provided, but also how are they used.
AWS provides various EC2 instance types and sizes from which to choose. As your AWS environment grows, ensuring proper recovery of your EC2 instances is essential. Learn more in our how-to guide detailing 3 ways to backup and recovery AWS EC2 for both Linux and Windows.