EC2 CPU options feature to optimize BYOL costs
Customize the CPU cores and threads.
Nihilson Gnanadason
Amazon Employee
Published Jan 2, 2025
A recent conversation about the x2idn.16xlarge EC2 instance type highlighted an intriguing feature that can significantly impact how we manage our cloud resources and associated costs. The x2idn.16xlarge instance, known for its robust performance with 64 vCPUs, presents an interesting challenge when it comes to running commercial database engines with per-CPU licensing models.
The question arose: Is it possible to optimize the CPU count from 64 to 32 to lower the bring-your-own-license (BYOL) costs? The answer lies in a powerful yet often overlooked feature called EC2 CPU options.
EC2 CPU Options is very useful for businesses running software with CPU-based licensing. This feature allows users to customize the number of vCPUs on supported EC2 instance types, including the x2idn.16xlarge. By specifying fewer vCPUs than the default configuration, you can potentially slash your software licensing costs without necessarily sacrificing the other benefits of the instance type, such as memory or storage capabilities.
For example, with the x2idn.16xlarge, you could configure it to use 32 vCPUs instead of the default 64, potentially halving your licensing costs for CPU-based software. This level of flexibility is crucial in today's cloud environments where optimizing costs is as important as maintaining performance.
- You can configure the instance to use fewer vCPUs than the default (64 for x2idn.16xlarge).
- This is done either at instance launch or by modifying a stopped instance.
- You can specify any even number of vCPUs up to the maximum for the instance type.
- Reduce software licensing costs for CPU-bound applications.
- Optimize CPU-to-memory ratio for specific workloads.
- Potentially improve performance for applications that don't need high core counts.
- The base price of the instance remains the same, regardless of the number of active vCPUs.
- Memory and other resources remain unchanged.
- Some OS-level tools might still report the full number of vCPUs.
Use the AWS Management Console, AWS CLI, or AWS SDKs to configure CPU options.
For example, using the AWS CLI:
aws ec2 run-instances \
--image-id ami-1a2b3c4d \
--instance-type r5.4xlarge \
--cpu-options "CoreCount=8,ThreadsPerCore=1" \
--key-name MyKeyPair
aws ec2 modify-instance-cpu-options \
--instance-id i-1234567890abcdef0 \
--core-count=4 \
--threads-per-core=2
Note :
CPU options feature provides a way to potentially address your goal of reducing the active CPU count to 32 for licensing purposes. However, it's crucial to test thoroughly for performance requirements and consult with your vendor to ensure this approach aligns with your licensing agreements.
In conclusion, whether you're running a commercial database engine or any other software with CPU-based licensing, it's worth exploring the EC2 CPU options feature. It could be the key to unlocking substantial savings while maintaining the performance levels your applications require. Always remember to test thoroughly and monitor your workloads after making such changes to ensure they continue to meet your performance expectations.
- AWS Blog with example for Optimize CPU : https://aws.amazon.com/blogs/modernizing-with-aws/optimize-cpu-best-practices-for-sql-server-workloads/
- AWS CLI to update CPU cores - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-specify-cpu-options.html#change-vCPUs-after-launch
- Rules for defining CPU options - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-cpu-options-rules.html
- Supported CPU Options by Instance Type - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.