Compare costs by AWS EC2 instance type

Introduction

I am using AWS EC2 while managing the web server. However, due to the high cost, Savings Plan and Spot Instances are also being used. In addition, there is a difference in the amount depending on the type of instance, such as CPU Architecture and memory, and the region.

We analyze the cost by comparing the type of instance of AWS EC2. I usually use the Seoul Region (ap-northeast-2), I would like to compare it based on this.

AWS EC2 Instance Types

Instance types are classified into General Purpose, Compute Optimized, Memory Optimized, etc. Each of them is described as follows.

  • General Purpose : Balance CPU, memory, networking resources, and more
    • T type : Cheapest Instance type; Burstable Instance Improves instantaneous performance when needed
    • M type : Basic general-purpose instance type; 4GiB of memory per vCPU
  • Compute Optimized : Perfect for computing with high-performance processors
    • C type : Basic compute optimization instance type; 2 GiB of memory per vCPU (C5n, C4 exception)
  • Memory Optimized : Provides fast processing performance for large amounts of data in memory
    • R type : Primary memory optimization instance type; 8 GiB of memory per vCPU (R4 exception)

Compare costs by type of instance

Let’s compare the costs by instance type. The costs mentioned here are excluding VAT. Charges are charged in local currency based on the exchange rate in the USD.

Even if it is the same type of instance, the fee varies depending on the size. It varies from nano, the smallest size, to metal server, and only the cheapest T type has a size less than small. I think this is one of the reasons why the T type is used easily.

The analysis is based on the large size of the Linux instance, which is widely used as a server operating system. The comparison based on the latest generation of instances of the same family is as follows.

Instance TypeInstance NameMemoryArchitectureCost / hr.
General Purpose (Burstable)t4g.large8GiBAArch64US$0.0832
General Purposem7i.large8GiBx86_64US$0.1239
General Purposem7g.large8GiBAArch64US$0.1003
Compute Optimizedc7i.large4GiBx86_64US$0.1008
Compute Optimizedc7g.large4GiBAArch64US$0.0816
Memory Optimizedr7i.large16GiBx86_64US$0.1596
Memory Optimizedr7g.large16GiBAArch64US$0.1292
AWS EC2 Cost Table, Based on Seoul Region (ap-northeast-2)

If the instance type and generation are the same, an instance using the AArch64 architecture is approximately 20% cheaper than an instance using the x86_64 architecture. However, it is difficult to change directly because the CPU architecture is different. In particular, after the end of Free Tier, the process of migrating the x86_64 architecture to the AArch64 architecture was inconvenient.

Conclusion

If the type of processor is not important, using an instance of the AArch64 architecture is considered to be cost-saving. There may be a difference in performance from the x86_64 architecture, but this is because the cost is 20% cheaper. If we have time later, we plan to share the results by analyzing the cost-effectiveness of each AWS EC2 instance type.

Leave a Reply