Steps to Choose the Right Amazon EC2 Instance Type
Published: 2022-02-02 11:14:35

**How can you decide which EC2 instance is best for you?**


Amazon EC2 (Elastic Compute Cloud) instances provide virtual computing capacity in the AWS cloud. The elasticity refers to the ability of users to scale their compute power up or down, on demand, to handle changes in requirements.

Type of instance depends on applications you are developing and running on AWS.

**Step-1: Monitor following things in to your application workload:**

- Optimum CPU
- Memory
- storage
- Networking

**Example:**

Requirement for one of application is as below:

- Optimum CPU - 8Vcpu
- Memory      - 32Gib
- Storage    - application is not using instance storage
- Networking - Moderate ( application is not network incentive) 

**Step-2: Select Instance Types:**

Instances are categorized by the diverse capabilities that they provide for your workloads:


**1. AWS General Purpose Instances:**


General purpose instances provide a blend of compute, memory and networking resources.

Use-case: business critical applications, small and mid-sized databases, web servers and code repositories.

Instance types within this family are the following:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kj5c3ct4mj8gooads09t.png)

Example: Application is web application for business prospective Try above instances and Monitor Your cpu and memory. If Cpu Goes high above 60% Then go for type-2 instances. If memory goes high above 60% then go for type-3 instances.


**2. AWS Compute Optimized Instances**
Compute Optimized instances are designed for compute-intensive applications that require high performance processors.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvavi8g0io6wfdw2hh2u.png)

**3. AWS Memory Optimized Instances**

Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/413vaf2xzkga9ao3l36q.png)

**4. AWS Storage Optimized Instances**
Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4dgokaigsx0rsxukvzw.png)

**5. AWS Accelerated Computing Instances**

Accelerated computing instances use co-processors to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gu0hlrrqjxda4sq4jh69.png)

**Step-3: Compare instances price and Performance**

Example: As our application is web based and requires 8Vcpu 32Gib Following General purpose instances are available.

Make the following type of table as per your requirement. Information is available on aws console for all instances in instance type.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kov199wnm13iwn8awf10.png)


**Step-4: Change the type as per above table and monitor your application performance and select best for your application.**


Following are my application work on different instances.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vcudzq32waeulzyk9qo1.png)


There is no major impact of performance for application on all above instance so we can choose according to price for above instance.