New features to reduce and optimize vCPUs on Amazon RDS for Oracle Database
Disclaimer: Any discussion of Oracle licensing policies and costs in this blog post is for informational purposes only and is based on the information available at the time of publication. For more specific information, users should consult their own Oracle license agreements.
Many AWS users are taking advantage of the managed service offerings that are available in AWS to remove much of the undifferentiated heavy lifting from their day-to-day activities. Amazon Relational Database Service (Amazon RDS) is one of the available managed services for your relational database deployments. With Amazon RDS, you can significantly reduce the administrative overhead of managing and maintaining a relational database. Amazon RDS makes it easy to set up, operate, and scale Oracle Database deployments in the cloud. You can deploy multiple editions of Oracle Database in minutes with cost-efficient and resizable hardware capacity. For details, see Amazon RDS for Oracle Database.
Like all AWS services, our Amazon RDS roadmap is driven mostly by customer feedback and requests for product enhancement. We have received feedback from several enterprise customers who are running their database workloads on Amazon RDS for Oracle Database. The feedback suggests that enterprises that run Oracle workloads can enhance the value of their software licenses by keeping the RAM per physical core ratio significantly higher than what is offered on Amazon RDS for Oracle.
We heard similar feedback from customers who operate memory-intensive database workloads. These databases often require additional memory with very few or no CPUs required to sustain the growth of the workload. Given this constraint, customers ended up over-provisioning their CPUs to get more memory. But because Oracle has a CPU-based licensing scheme for Oracle Database software, this action results in additional licensing costs.
The goal of this post is to describe how you can reduce the number of virtual CPUs (vCPUs) and manage licensing costs for your database workloads by using two new features for Oracle Databases on Amazon RDS:
- X1 and X1e instance support
- Optimize CPU
Launch #1: Support for X1 and X1e instances in Amazon RDS for Oracle
Recent customer examples and feedback suggest that enterprises running Oracle workloads can enhance the value of their software licenses by keeping the RAM per physical core ratio greater than 30.
Amazon RDS supports three types of instance classes: Standard, Memory Optimized, and Burstable Performance. For more information about Amazon EC2 instance types, see Instance Types in the Amazon EC2 documentation. For information about all the DB instance types that Amazon RDS for Oracle supports, see DB Instance Class.
As of May 25, 2018, you can now launch an Amazon RDS for Oracle database on the X1 and X1e instance types. X1 and X1e instances offer the highest ratio of memory to vCPU among current Amazon EC2 instance types. The X1e instance type provides 30.5:1 RAM (GB) per vCPU or 61:1 RAM (GB) per physical core ratio (for example, db.x1e.16xlarge comes with 64 vCPUs and 1952 GB of RAM). The X1 instance type provides 15.25:1 RAM (GB) per vCPU or 30.5:1 RAM (GB) per physical core ratio (for example, db.x1.16xlarge comes with 64 vCPUs and 976 GB of RAM).
The X1 and X1e DB instance types are optimized for memory-intensive and latency-sensitive database workloads, including data analytics, in-memory databases, and high-performance production workloads. X1 and X1e instances let you enhance the value of your Oracle licenses by increasing memory without increasing processor license counts.
Launch #2: Optimize CPU in Amazon RDS
Before the Optimize CPUs capability became available in Amazon EC2, you were limited to selecting EC2 instances that best matched the RAM-to-core ratio requirements of your workloads. This frequently led to suboptimal vCPU selections, which resulted in very high licensing costs. X1/X1e instance support in Amazon RDS for Oracle provides the highest ratio of memory to vCPU. It can help with vCPU-based licensing costs because you can now get a sufficient amount of RAM with a smaller number of vCPUs.
X1 and X1e instances can help with your workloads, but there is still a fixed ratio between memory and vCPU. That is, if you’re running workloads that primarily require more memory to satisfy your workload growth, you will have to add more CPUs to get more memory. For example, if you’re running a memory-intensive workload that requires about 1 TB of RAM and 16 vCPUs to meet your requirements, the best option is the DB instance type db.X1e.8Xlarge. But this instance type comes with 32 vCPUs, and you would have to get licensing for 16 additional vCPUs.
Following the Optimize CPUs launch announcement from EC2 (which was met with delight from House of Brick Technologies), we are extending the optimize CPU feature to Amazon RDS for Oracle. With Optimize CPU, you can select EC2 instances with optimal memory, storage, and networking, while enabling only the vCPUs that you need, thus managing your vCPU-based licensing costs.
This feature can help you do the following:
- Specify a custom number of vCPUs (while enjoying the same memory, storage, and bandwidth of a full-sized instance) when launching new Amazon RDS for Oracle instances.
- Optionally disable Intel Hyper-Threading Technology (Intel HT Technology) for workloads that perform well with single-threaded CPUs, such as certain high-performance computing (HPC) applications.
Intel HT Technology is enabled by default on EC2 instance types, but certain applications (such as HPC applications) are not designed to benefit from it. When Intel HT Technology is enabled, compute-intensive workloads experience performance degradation due to context switching. This feature enables those customers to fine-tune application performance and manage licensing costs.
Optimize CPU components
In most cases, there is a DB instance class that has a combination of memory and number of vCPUs to suit your workloads. However, you can specify the following processor features to optimize your DB instance for specific workloads or business needs.
To configure the Optimize CPU feature on the DB instance class for a DB instance, you use the AWS CLI and include the
processor-features option in the command. The
processor-features attribute takes the following two parameters as input:
- Number of CPU cores (coreCount): The
coreCountattribute specifies the maximum number of CPU cores available for use on the DB instance. You can customize the number of CPU cores for the DB instance and still be able to use the same memory, storage, and bandwidth of a full-sized instance. You can use this feature to manage the vCPU-based licensing costs of your software with a DB instance that has sufficient amounts of RAM for memory-intensive workloads but fewer CPU cores. Consider our earlier example in which the primary requirement was to have a DB instance with close to 1 TB memory and 16 vCPUs. The DB instance type db.x1e.8xlarge best matches the requirement (with 976 GB RAM and 32 vCPUs), but with the downside that it will require additional licensing for those extra 16 vCPUs. Now with the Optimize CPU feature, you can customize the db.x1e.8xlarge instance and use only 16 vCPUs (which requires Oracle Database licensing for only 16 vCPUs). You can still use the total available memory, storage, and networking capacity of the DB instance.
- Threads per core (threadsPerCore): Using the
threadsPerCoreattribute, you can disable Intel HT Technology by specifying a single thread per CPU core. You might do this for certain workloads, such as HPC workloads.
You can control the number of CPU cores and threads per core separately. You can set one or both in a request. After a setting is associated with a DB instance, the setting persists until it is changed.
You can configure the number of CPU cores and threads per core for the DB instance class in the following operations:
- Creating a DB instance
- Modifying a DB instance
- Restoring a DB instance from a snapshot
- Restoring a DB instance to a point in time
For additional details on the Optimize CPU feature for Amazon RDS for Oracle, see Configuring the Processor for a DB Instance Class.
Implementing Optimize CPU on Amazon RDS DB instances running Oracle
Now that you understand how the Optimize CPU feature works, it’s time to implement it. In this example, we use the AWS CLI utility to implement the Optimize CPU features. For details on how to configure the AWS CLI, see Configuring AWS CLI.
By default, Amazon RDS DB instance classes support Intel Hyper-Threading Technology, which enables multiple threads to run concurrently on a single Intel Xeon CPU core. Each thread is represented as a vCPU on the DB instance. A DB instance has a default number of CPU cores, which varies according to DB instance type. For example, a db.r4.4xlarge DB instance type has eight CPU cores and two threads per core by default—16 vCPUs in total.
By default (without the Optimize CPU feature), an Amazon RDS for Oracle DB instance is created with the 16 vCPUs and hyper-threading enabled. With Optimize CPU, you can specify the subset of total vCPUs on the instance and disable the hyper-threading on the DB instance.
Enabling Optimize CPU when creating a new DB instance
Follow these steps to enable the Optimize CPU feature when you first create your DB instance:
- Query the allowed values for the specific Amazon RDS DB instance type that you plan to use for creating the Amazon RDS for Oracle Database instance. The AWS CLI has added a new API called
describe-orderable-db-instance-options. You can use it to view all possible values for the
threadsPerCorefor a specific DB instance. The following example uses the DB instance type
db.r4.4xlarge. The output of the command is truncated, and only the relevant output is shown. For all available DB instances supported on Amazon RDS for Oracle, see DB Instance Class.
- Create the Amazon RDS for Oracle DB instance with the Optimize CPU feature on. In this example, you create the DB instance and enable the Optimize CPU feature using the
processor-featuresattributes to specify any of the allowed values for the
threadsPerCoreattributes. The following example creates the DB instance on a db.r4.4xlarge instance type, allocating only two physical cores (out of total eight physical cores) and disabling the hyper-threading.
The preceding AWS CLI command
create-db-instancerequires several input parameters. The following table contains the description of the parameters used in the example.
Attribute name Attribute Value 1
User-defined name for the Amazon RDS for Oracle DB instance identifier (set to
optimized-cpu-dbin the example).
Oracle Database engine edition (set to
oracle-eein the example).
Oracle Database engine version (for example,
User-defined DB instance class for the Amazon RDS for Oracle DB that matches your workload requirement (for example,
User-defined value for the Amazon RDS for Oracle Database master user (set to
adminin the example).
User-defined value for the Amazon RDS for Oracle Database master user’s password (set to
passwordin the example).
User-defined value for the Amazon EBS storage (GB) allocated to the Amazon RDS for Oracle DB instance. 8
User-defined value for the AWS Region in which the DB instance needs to be created (for example,
Allows you to specify a particular virtual private cloud (VPC) when creating DB instances (set to use the default db-subnet in the example). 10
Option to enable the optimize CPU feature, user-defined values for the
threadsPerCorewithin the allowed values for the specific instance type (in the example,
coreCountis set to 2 and
threadsPerCoreis set to 1).
- Verify that the Optimize CPU feature is enabled on the created instance. After the DB instance is created, you can verify whether the Optimize CPU feature has been enabled by using the AWS CLI command
describe-db-instances. If the Optimize CPU option has been enabled, the output of this command will have an additional section
ProcessorFeatures. It will display the
threadsPerCorefor the DB instance as shown in the following example. (The output is truncated to show only the relevant details.)
Using Optimize CPU after the DB instance is created
Optimize CPU is not only configurable when you create an Amazon RDS DB instance running Oracle, but you can also configure it after the instance is created. You can specify the number of CPU cores and threads per core for the DB instance class using the
Before you decide to modify the DB instance and provide customized values for the
threadsPerCore, you can use the
describe-valid-db-instance-modifications AWS CLI command to look at the possible allowed values for these attributes, as shown following. (The output is truncated to show only the relevant details.)
From this output, you can see the allowed values for the Optimize CPU features for the Amazon RDS for Oracle DB instance that you created earlier, in step 2.
Now you can proceed with modifying your DB instance. You will be using the custom values for
4 respectively, as shown following. This example uses a flag—apply-immediate—to instruct Amazon RDS to apply the modification immediately (this action results in the reboot of the database and will incur a small down time).
When the DB instance modification is finished, you can verify the change in the
threadsPerCore of the DB instance by running the
describe-db-instances AWS CLI command. The output is truncated to show only the relevant details.
Resetting the DB instance to the default processor configuration
By default, the Optimize CPU feature is disabled on Amazon RDS for Oracle. This means that all the Amazon RDS for Oracle DB instances are created with the default processor configuration for the underlying Amazon RDS DB instance type. The example uses the db.r4.4xlarge DB instance type and the default configuration (with the Optimize CPU feature disabled). The Amazon RDS for Oracle DB instance is then created with all the 16 vCPUs and hyper-threading enabled.
We already enabled the Optimize CPU features and have used only a subset of the physical cores available on the DB instance. But we have the option to modify the Amazon RDS for Oracle DB instance and bring it back to the default configuration (that is, with all the physical cores and hyper-threading enabled). You can use the
modify-db-instance AWS CLI command and the flag
--use-default-processor-features, as shown following. The output is truncated to show only the relevant details.
When the DB instance modification is finished, you can verify the changes by running the
describe-db-instances AWS CLI command. Because you disabled the Optimize CPU feature and modified the DB instance to the default configuration, the output of the
describe-db-instances command doesn’t have the section for
Processor Features that displays the
CoreCount and the
threadsPerCore, as shown in the following output.
The output is truncated to show the relevant details. Note that the section for the
Processor Features after
EngineVersion and before the
CharacterSetName attributes is missing from the output.
In this post, I discussed two recently launched features for Amazon RDS for Oracle Database. These features can help you manage your Oracle Database software licensing costs and enable support of larger Oracle Database workloads on Amazon RDS.
I demonstrated how you can implement the Optimize CPU feature to specify custom values for the
CoreCount and hyper-threading on Amazon RDS for Oracle while creating a new DB instance. In addition, I showed how to modify
CoreCount and hyper-threading any time after instance creation, and finally, how to revert the DB instance to the default behavior with all the
CoreCount and hyper-threading enabled.
We hope that you found this information useful, and we’re looking forward to learning how these two new features help with optimizing the licensing costs for your specific workloads.
About the Authors
Sameer Malik is a database specialist solutions architect. He works with AWS customers to provide guidance and technical assistance on database projects, helping them improve the value of their solutions when using AWS.