AWS Basics: EC2 Instance Types

Elastic Compute Cloud (EC2)

Amazon Web Services (AWS) offers a variety of cloud computing services. Elastic Compute Cloud (EC2) is one of the most important elements in AWS because many services are derived from it. EC2 is similar to running virtual machines on the cloud. To get started on using AWS, you should first learn about EC2 instance types.

Instance types

EC2 instance types offers a combination of CPU, memory, storage and networking capacity.

For demo purpose, screen captures will be included for general purpose instances. For the selection of other instance types, please refer to AWS official documentation. You can also create a free AWS account to try them out.

#1) General purpose instances

Compute-optimized instances are balanced in terms of CPU, memory and networking configurations.

Examples:

T series instances commonly used for web applications and micro-services

EC2 T Series Instance Types - x86 architecture
EC2 T Series Instance Types – x86 architecture
EC2 T Series Instance Types - Arm architecture
EC2 T Series Instance Types – Arm architecture

M series instances suitable for application, gaming and simulation related workloads

Note that M series instances support higher network throughput compared to T series instances, as shown on the below screen capture.

Also, m5.metal type is available, which refers to a bare metal instance type. Bare metal instance means the system runs on the underlying hardware and has direct access to the hardware components – in order words, just like a typical physical server. This type of instance is useful for hosting applications which require direct access to the underlying hardware due to software design or licensing requirement.

EC2 M Series Instance Types - x86 architecture
EC2 M Series Instance Types – x86 architecture

Mac1 for development work related to Apple devices

EC2 Mac1 Series Instance Types
EC2 Mac1 Series Instance Types

#2) Compute-optimized instances

Compute-optimized instances are useful in scenarios where applications benefit from high compute processing power.

Examples:

C series instances typically for compute-intensive workloads such as video encoding, modeling and batch processing jobs

#3) Memory-optimized instances

Memory-optimized instances are suitable for database workload processing, which is typically memory intensive.

Examples:

R, X and Z series instances for MySQL and memcached services

#4) Storage-optimized instances

Resources running on storage-optimized instances benefit from higher storage I/O performance.

Examples:

D, H and I series instances for centralized log processing such as rsyslog service. They are also suitable for hosting distributed storage systems like GlusterFS, where multiple hosts access files on shared storage resources.

Other Tips

Tips #1: Selection of Instance Types

Check developer / software vendor suggestions in terms of the suggested instance types for hosting the required applications. You can find more information on AWS Marketplace and application documentations.

AWS Marketplace - NGINX Plus Suggested EC2 Instance Types
AWS Marketplace – NGINX Plus Suggested EC2 Instance Types
AWS Documentation - Splunk Suggested EC2 Instance Types
AWS Documentation – Splunk Suggested EC2 Instance Types

Tips #2: Selection of Amazon Machine Image (AMI)

You should select Amazon Machine Image (AMI) prior to choosing instance types. Note that AMIs can be originated from AWS official images, your images, AWS marketplace (typically crafted by software vendors), as well as Community versions. Their availability vary based on AWS region setting. As an example, macOS images are available on N. Virginia (us-east-1) but cannot be found on other regions such as Hong Kong (ap-east-1).

EC2 Choose Your Own AMIs
EC2 Instance Provisioning – Choose Your Own AMIs
EC2 ap-east-1 macOS AMI Availability
EC2 ap-east-1 (Hong Kong) – macOS AMI Availability
EC2 us-east-1 macOS AMI Availability
EC2 us-east-1 (N. Virginia) – macOS AMI Availability

Tips #3: Processor Architecture of Instance Types

There are two mainstream processor architectures which you need to choose from when you select an instance type, namely 64-bit (x86) and Arm. You can only choose an instance type of a processor architecture that is compatible with your selected Operating System (OS). For instance, Ubuntu Server supports both x86 and Arm architecture. You must first decide on the architecture type when choosing an Ubuntu Server AMI. Afterwards, only compatible EC2 instance types can be selected on the web console.

EC2 AMI Selection of Processor Architecture
EC2 AMI – Selection of Processor Architecture
EC2 Instance Types Disabled due to Incompatible Processor Architecture
EC2 Instance Types Disabled due to Incompatible Processor Architecture

Conclusion

EC2 instances are virtual machines on the cloud. You can provision EC2 instances for running a variety of applications, ranging from NGINX and Apache web servers to MySQL and MariaDB databases. You may even create instances that are suitable for running Windows Server and macOS operating systems. When provisioning an EC2 instance, you can select an instance type of your preference after choosing an AMI. One caveat is that an images is only compatible to an instance type of the same processor architecture (x86 or Arm).

AWS EC2 service provides flexibility in choosing the amount of processing power based on your application requirements. The rule of thumb is to refer to system requirement documentations when selecting an EC2 instance type so that you will not under-provision resources, and vice versa. Rest assured, you can change your instance types after provisioning resources in case you discover a better option or if there is a change in requirement. Your machine image is not bound to an instance type – just create a new instance, select your existing AMI and choose a new instance type!

Looking Forward

EC2 does not only provide the capacity to provision virtual machines as there are a lot of add-on services which can help you scale your infrastructure automatically. As EC2 provides on-demand instance provisioning service, you can make use of Elastic Load Balancing to ensure that no single instance has to carry all the workload on its own. In addition, you can easily satisfy availability requirements by running applications in instances which split across availability zones in a region. Stay tuned if you are interested in learning other types of services which are closely related to EC2.