AWS has a lot of different instance types and it can be difficult to decide which instance type would be the best for a particular use-case. In this article, we will compare two popular instance types: C6g and C5, across various dimensions such as their specs, their performance as well the cost.

Comparing the C5 and C6g instance families

Both C5 and C6g instance families are optimized for compute-bound applications.

The key difference between the two instance families is that the C6g instances are powered by Arm-based AWS Graviton2 processors.

Performance

We compared the performance between these instance families by running a bunch of tests on the following instances:

  • c6g.2xlarge
  • c5.2xlarge
Instance Type Number of cores Memory (GB)
c6g.2xlarge 8 16
c5.2xlarge 8 16

We will be using Sysbench to run various tests to measure the CPU, Memory and Disk performance.

CPU

We ran the CPU benchmark using the following command: sysbench cpu --cpu-max-prime=20000 --threads=8 run. We will be comparing the total time as well as the total number of events for the benchmark from start to end.

As we can see from the results below, c6g.2xlarge performed much better as compared to c5.2xlarge.

c6g.2xlarge

General statistics:
    total time:                          10.0009s
    total number of events:              86278

c5.2xlarge


General statistics:
    total time:                          10.0022s
    total number of events:              28276

Memory

We ran the CPU benchmark using the following command: sysbench memory --memory-block-size=1M --memory-total-size=100G --num-threads=8 run. We will be comparing the Operations performed for the different instance types.

In this benchmark, c6g.2xlarge performed much better than c5.2xlarge.

c6g.2xlarge


Total operations: 102400 (101111.56 per second)

102400.00 MiB transferred (101111.56 MiB/sec)

General statistics:
    total time:                          1.0111s
    total number of events:              102400

c5.2xlarge


Total operations: 102400 (62851.50 per second)

102400.00 MiB transferred (62851.50 MiB/sec)

General statistics:
    total time:                          1.6279s
    total number of events:              102400

Pricing

We compared the prices between these instance families by looking at the price per hour for each instance type.

C6g instances are significantly cheaper compared to their C5 counterparts.

Price/core for Linux on-demand instances:

Instance Type Price / hour
c6g.2xlarge $0.2720
c5.2xlarge $0.3400

Conclusion

The new C6g instances offer better performance as well as price when compared to the C5 instances and should be the go-to instance type for use-cases that required compute-optimized instances.