Codementor Events

vCPUs and cost implications in right-sizing of for EC2 instances - Insisive Cloud

Published Jun 04, 2019
Posted By:insisivecloud
Posted on:23 Apr 2019
Cost Optimization

vCPUs are the base unit of compute capacity for EC2 instances. They represent one of the main criteria for selecting an EC2 instance type.

What does vCPU really represent on a physical host? and more importantly – are all vCPUs the same?  Let us explore this in a bit of detail. The cost implications will also become clear once we understand it.

Each vCPU is a hyper-thread of an Intel Xeon core (except for T2). More details here

T2 instances have a slightly winding explanation and feature ‘burstable’ or occasional spikes that the originally available compute capacity.

Note that the definition says  hyper-threaded  instead of  virtual core..  Or about  2  hyper-threads per core. Als,o note that doesn’t mean the hyper-threads share 50% of each core.

If you want to get a  good understanding of hyper-threading, take some time to read this excellent article from ArsTechnica about HT or SMT.

The interesting aspect to note ( and something that is often lost to those new to virtualization) is that vCPUs are not a standard measure in a way a ‘meter’ or ‘ mile’ is defined.  This merely indicates that from the underlying host,  ‘n’ vCPUs are virtualized.

Compute capacity also depends upon other host characteristics such as cache, bus speed and QPI of the host itself would change.

E.g. vCPUs based on Intel Xeon 2676 ( up to m4.8x large) and vCPUs based on Intel Xeon 2686 ( m4.10xlarge and greater), m4.10xlarge or above would give better performance per vCPU on account of the difference in the host ( benchmark comparison for both Xeon processors )

The amount of performance you can get out of an instance is also dependent on how much processors state can be controlled via Linux ( e.g. C-State and P-State optimizations )

And this great video:

AWS re:Invent 2017: Deep Dive on Amazon EC2 Instances, Featuring Performance Optimize (CMP301)

Let’s consider an example.

Consider C5.2xLarge and C4.2xLarge instance types.

| Name | API Name | Memory | vCP
Us | Instance Storage | Network Performance | Linux On Demand cost | Linux Reserved cost | Windows On Demand cost | Windows Reserved cost |
| C5 High-CPU Double Extra Large | c5.2xlarge | 16.0 GiB | 8 vCPUs | EBS only | Up to 10 Gbps | $0.340000 hourly | $0.214000 hourly | $0.708000 hourly | $0.582000 hourly |
| C4 High-CPU Double Extra Large | c4.2xlarge | 15.0 GiB | 8 vCPUs | EBS only | High | $0.398000 hourly | $0.252000 hourly | $0.766000 hourly | $0.620000 hourly |

From ec2instances.info

While both have the same 8 vCPUs and almost similar memory.

The C5 family uses 3.0 GHz Intel Xeon Platinum processors with new Intel Advanced Vector Extension 512 (AVX-512) instruction set and C4 family uses Intel Xeon E5-2666 v3. C5 2x large has a better spec, marginally lower cost per hour, better virtualisation model (Nitro) with less variability and delivers up to 25% more performance compared to C4 instance types. However, C5 does need AMIs that include drivers for ENA and NVMe.

On a general note and at risk of broad oversimplification, vCPUs of current generation instances give better compute performance compared to previous generation( C5 better than C4 ) and instances of higher instance types give better performance per unit cost compared to their lower siblings ( e.g. m4.10xlarge better than m4.8xlarge).   A good practical method suggested  by AWS is here

Conclusion

While the vCores give valuable information about the compute capacity, taking the number of cores alone into consideration during selection of instances can trip your application up in unexpected ways. Any choice of instance type should take into all the other options available and benchmark them before finalizing on the instance type.

A service like insisive cloud can help analyze your AWS infrastructure using rule-based policies for cost optimization and help with rapid prototyping at costs up to 60% less.

Discover and read more posts from Rajesh Kanukollu
get started
post commentsBe the first to share your opinion
Show more replies