Monday, December 15, 2025

Exploring Optimize CPU characteristic on Amazon RDS for SQL Server


Amazon Relational Database Service (Amazon RDS) for SQL Server now helps the Optimize CPU characteristic. With the Optimize CPU characteristic you may outline the variety of cores once you launch new cases or when modifying present database cases. It’s obtainable ranging from the seventh Technology occasion class. It gives the next advantages:

  • Customise the variety of vCPUs on your RDS SQL Server cases
  • Obtain desired memory-to-CPU ratios for particular workloads
  • Doubtlessly cut back licensing prices and achieve extra flexibility in total value administration

On this publish, we discover how you need to use the Optimize CPU characteristic with Amazon RDS for SQL Server, together with:

  1. Creating a brand new occasion by configuring Optimize CPU
  2. Modifying an present occasion with Optimize CPU
  3. Restoring from a snapshot that’s configured with Optimize CPU
  4. Performing a point-in-time restore (PITR) with Optimize CPU

Conditions

The examples on this publish use the AWS Command Line Interface (AWS CLI). You need to have primary information of making an RDS for SQL Server DB occasion and perceive CPU structure ideas (cores, threads per core, and vCPUs).

You must also be conversant in how the Optimize CPU characteristic impacts each Amazon RDS for SQL Server pricing and DB occasion efficiency.

Creating a brand new occasion with Optimize CPU

To create an RDS SQL Server occasion with Optimize CPU, use the create-db-instance command with the --processor-features parameter. Specify values for coreCount and threadsPerCore. The next command creates an occasion with 8 cores and 1 thread per core, leading to 8 vCPUs whole.

aws rds create-db-instance --region us-west-2 
--engine-version 16.00 
--allocated-storage 100 
--license-model license-included 
--master-username admin --master-user-password XXXXX 
--no-multi-az 
--publicly-accessible 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--db-instance-identifier rfs-test-ocpu-instance 
--db-instance-class db.r7i.8xlarge 
--engine sqlserver-ee 
--processor-features "Title=coreCount,Worth=8" "Title=threadsPerCore,Worth=1"

When utilizing this command:

  • It’s necessary to specify each coreCount and threadsPerCore for --processor-features parameter.
    • coreCount: You possibly can customise the variety of CPU cores for the occasion. See DB occasion courses that help Optimize CPU to search out the allowed values for core depend for a specific occasion sort.
    • threadsPerCore: Threads per core is configured to outline the variety of threads per CPU core. Ranging from the seventh era occasion class sort, the optimized CPU characteristic is supported, and the allowed worth for threads per core is 1, because the seventh era occasion has Hyper-threading disabled.
  • The --processor-features parameter requires a minimal of 4 vCPU for Amazon RDS for SQL Server.

To confirm these settings, use the describe-db-instances command:

----------------------------------------------------------------------------------
|                               DescribeDBInstances                              |
+-----------------+--------------------------+---------------+-------------------+
| DBInstanceClass |  DBInstanceIdentifier    |    Engine     |   EngineVersion   |
+-----------------+--------------------------+---------------+-------------------+
|  db.r7i.8xlarge |  rfs-test-ocpu-instance  |  sqlserver-ee |  16.00.4215.2.v1  |
+-----------------+--------------------------+---------------+-------------------+
||                               ProcessorFeatures                              ||
|+---------------------------------------------------+--------------------------+|
||                       Title                        |          Worth           ||
|+---------------------------------------------------+--------------------------+|
||  coreCount                                        |  8                       ||
||  threadsPerCore                                   |  1                       ||
|+---------------------------------------------------+--------------------------+|

The next is an outline of the Optimize CPU characteristic because it seems within the AWS Administration Console.


Word: We suggest benchmarking your workload with the Optimize CPU characteristic in order that the configured vCPU can deal with the workload with out inflicting useful resource constraints on your workload or RDS automation.

Modifying an present occasion with Optimize CPU

Occasion modification with –use-default-processor-features

To revert an Optimize CPU occasion to default settings, you need to use the --use-default-processor-features parameter.

For instance, the next command modifies an present occasion (rfs-test-ocpu-instance) that’s configured with a db.r7i.8xlarge occasion sort and processor characteristic setting of 8 cores and 1 thread, to its default settings.

aws rds modify-db-instance --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance 
--use-default-processor-features 
--apply-immediately

Within the earlier instance, the prevailing occasion of db.r7i.8xlarge configured with Optimize CPU settings of 8 cores and 1 thread per core is transformed again to make use of the default settings of db.r7i.8xlarge occasion sort with 16 cores and 1 thread per core.

For Multi-AZ cases, each the first and secondary cases could have equivalent vCPU configurations in accordance with processor characteristic settings.

Word: If you modify a DB occasion to configure Optimize CPU, there’s a temporary DB occasion downtime identical because it takes once you modify the occasion class sort

Occasion modification with –processor-features

You possibly can modify an present occasion to specify processor characteristic settings. For instance, the next command modifies an present occasion (rfs-test-ocpu-instance) that’s configured with a db.r7i.8xlarge occasion sort and default settings to customized setting of Optimize CPU.

aws rds modify-db-instance --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance 
--db-instance-class db.r7i.16xlarge 
--processor-features "Title=coreCount,Worth=8" "Title=threadsPerCore,Worth=1" 
--apply-immediately

By default, the db.r7i.16xlarge occasion helps 32 cores and 1 thread per core, leading to a complete of 32 vCPUs. Using the Optimize CPU characteristic with the desired settings, it would modify the occasion to eight cores and 1 thread per core leading to a complete of 8 vCPUs.

Restoring from a snapshot that’s configured with Optimize CPU

When restoring from a snapshot of an occasion with Optimize CPU enabled, the settings are copied to the goal occasion by default. You can too specify totally different Optimize CPU settings throughout the restore course of.

Snapshot restore with the Optimize CPU characteristic

On this instance, we’re utilizing a snapshot backup of an present occasion (rfs-test-ocpu-instance) configured with Optimize CPU settings. It makes use of db.r7i.16xlarge occasion sort and Optimize CPU settings of 8 cores and 1 thread per core, ensuing into a complete 8 vCPU’s.

To create a snapshot, run the next command:

aws rds create-db-snapshot --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance 
--db-snapshot-identifier backup-rfs-test-ocpu-instance

To explain the DB snapshot, run the next command:

aws rds describe-db-snapshots --region us-west-2 
--db-snapshot-identifier backup-rfs-test-ocpu-instance  
--query "DBSnapshots[*].{DBInstanceIdentifier:DBInstanceIdentifier,DBSnapshotIdentifier:DBSnapshotIdentifier,Engine:Engine,EngineVersion:EngineVersion,ProcessorFeatures:ProcessorFeatures}"

You get the next output:

------------------------------------------------------------------------------------------------
|                                      DescribeDBSnapshots                                     |
+-------------------------+---------------------------------+---------------+------------------+
|  DBInstanceIdentifier   |      DBSnapshotIdentifier       |    Engine     |  EngineVersion   |
+-------------------------+---------------------------------+---------------+------------------+
|  rfs-test-ocpu-instance |  backup-rfs-test-ocpu-instance  |  sqlserver-ee |  16.00.4215.2.v1 |
+-------------------------+---------------------------------+---------------+------------------+
||                                      ProcessorFeatures                                     ||
|+-------------------------------------------------------------+------------------------------+|
||                            Title                             |            Worth             ||
|+-------------------------------------------------------------+------------------------------+|
||  coreCount                                                  |  8                           ||
||  threadsPerCore                                             |  1                           ||
|+-------------------------------------------------------------+------------------------------+|

To revive from the snapshot, run the next command:

aws rds restore-db-instance-from-db-snapshot --region us-west-2 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--publicly-accessible 
--db-snapshot-identifier backup-rfs-test-ocpu-instance 
--db-instance-identifier rfs-test-ocpu-instance-3

For restore-db-instance-from-db-snapshot, we didn’t specify the occasion sort or Optimize CPU settings, so Amazon RDS creates an occasion with the identical occasion sort (db.r7i.16xlarge) and Optimize CPU settings (8 cores, 1 thread per core) from the snapshot.

There are a number of situations to make use of the Optimize CPU characteristic with snapshot restore.

Restore a snapshot to a distinct occasion sort and default processor options

You possibly can restore a snapshot taken on Optimize CPU enabled occasion by specifying the totally different occasion sort and --use-default-processor-features.

For this instance, we’re utilizing a snapshot backup of an present occasion (rfs-test-ocpu-instance) configured with Optimize CPU settings. The unique occasion makes use of a db.r7i.16xlarge occasion sort and Optimize CPU settings of 8 cores and 1 thread per core, leading to a complete of 8 vCPUs.

The next command restores a snapshot to a distinct occasion sort (db.r7i.8xlarge) with its default CPU settings (16 cores and 1 thread per core).

aws rds restore-db-instance-from-db-snapshot --region us-west-2 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--publicly-accessible 
--db-snapshot-identifier backup-rfs-test-ocpu-instance 
--db-instance-identifier rfs-test-ocpu-instance-5 
--db-instance-class db.r7i.8xlarge 
--use-default-processor-features

(Invalid) Restore a snapshot to a distinct occasion sort and no processor options set

When restoring a snapshot from an Optimize CPU-enabled occasion to a distinct occasion sort, you can not omit the processor characteristic settings. The next instance demonstrates what occurs in case you try this.

On this situation, we’re restoring a snapshot from an occasion (rds-test-ocpu-instance), configured with db.r7i.16xlarge, 8 cores, and 1 thread per core, to a distinct occasion sort (db.r7i.8xlarge) with out specifying processor options:

aws rds restore-db-instance-from-db-snapshot --region us-west-2 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--publicly-accessible 
--db-snapshot-identifier backup-rfs-test-ocpu-instance 
--db-instance-identifier rfs-test-ocpu-instance-6 
--db-instance-class db.r7i.8xlarge

This command fails with the next error:

An error occurred (InvalidParameterCombination) when calling the RestoreDBInstanceFromDBSnapshot operation: 
Your request should specify ProcessorFeatures settings or set UseDefaultProcessorFeatures for the reason that snapshot has ProcessorFeatures set.

When a snapshot has processor options enabled and also you specify a distinct occasion sort throughout restore, you need to explicitly present both the ProcessorFeatures settings or UseDefaultProcessorFeatures choice.

Restore a snapshot to a distinct occasion sort with customized processor options

For instance, the next command restores a snapshot of an occasion (rfs-test-ocpu-instance) configured with Optimize CPU settings (8 core and 1 thread per core) utilizing the db.r7i.16xlarge occasion sort. We specified a brand new occasion sort (db.r7i.12xlarge) and new Optimize CPU settings (18 cores, 1 thread per core).

aws rds restore-db-instance-from-db-snapshot --region us-west-2 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--publicly-accessible 
--db-snapshot-identifier backup-rfs-test-ocpu-instance 
--db-instance-identifier rfs-test-ocpu-instance-7 
--db-instance-class db.r7i.12xlarge 
--processor-features "Title=coreCount,Worth=18" "Title=threadsPerCore,Worth=1"

Level-in-time restore (PITR) with Optimize CPU

With Level-in-Time Restore (PITR) you may restore an occasion to a particular time limit. This course of entails restoring a particular snapshot primarily based on the designated time for PITR and subsequently making use of all transaction log backups to that snapshot, thereby bringing the occasion to the desired time limit.

For PITR, the processor characteristic settings for coreCount and threadsPerCore are derived from the supply snapshot (not the time limit) except customized values are specified throughout the PITR request. If the supply snapshot getting used is enabled with Optimize CPU and you might be utilizing a distinct occasion sort for PITR, you need to outline the Optimize CPU choices for the goal occasion or specify the --use-default-processor-features choice. The use circumstances described above for snapshot restore are additionally relevant to PITR.

TimeStamp-1: Describe supply database occasion that’s configured with Optimize CPU

For instance, we’ve an occasion (rfs-test-ocpu-instance-8) that’s run on a db.r7i.8xlarge occasion sort with Optimize CPU settings of 8 cores and 1 thread per core. The next command exhibits the occasion configuration.

aws rds describe-db-instances --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance-8 
--query 'DBInstances[].{DBInstanceIdentifier:DBInstanceIdentifier,Engine:Engine,EngineVersion:EngineVersion,ProcessorFeatures:ProcessorFeatures,DBInstanceClass:DBInstanceClass}'

The next is the command’s output:

------------------------------------------------------------------------------------
|                                DescribeDBInstances                               |
+-----------------+----------------------------+---------------+-------------------+
| DBInstanceClass |   DBInstanceIdentifier     |    Engine     |   EngineVersion   |
+-----------------+----------------------------+---------------+-------------------+
|  db.r7i.8xlarge |  rfs-test-ocpu-instance-8  |  sqlserver-ee |  16.00.4215.2.v1  |
+-----------------+----------------------------+---------------+-------------------+
||                                ProcessorFeatures                               ||
|+-----------------------------------------------------+--------------------------+|
||                        Title                         |          Worth           ||
|+-----------------------------------------------------+--------------------------+|
||  coreCount                                          |  8                       ||
||  threadsPerCore                                     |  1                       ||
|+-----------------------------------------------------+--------------------------+|

TimeStamp-2: Create a database snapshot

We run the next command to create a database snapshot.

aws rds create-db-snapshot --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance-8 
--db-snapshot-identifier pitr-backup-rfs-test-ocpu-instance-8

Now we use the next command to explain database snapshot:

aws rds describe-db-snapshots --region us-west-2 
--db-snapshot-identifier pitr-backup-rfs-test-ocpu-instance-8 
--query "DBSnapshots[*].{DBInstanceIdentifier:DBInstanceIdentifier,DBSnapshotIdentifier:DBSnapshotIdentifier,Engine:Engine,EngineVersion:EngineVersion,ProcessorFeatures:ProcessorFeatures}"

We get the next output:

---------------------------------------------------------------------------------------------------------
|                                          DescribeDBSnapshots                                          |
+---------------------------+----------------------------------------+---------------+------------------+
|   DBInstanceIdentifier    |         DBSnapshotIdentifier           |    Engine     |  EngineVersion   |
+---------------------------+----------------------------------------+---------------+------------------+
|  rfs-test-ocpu-instance-8 |  pitr-backup-rfs-test-ocpu-instance-8  |  sqlserver-ee |  16.00.4215.2.v1 |
+---------------------------+----------------------------------------+---------------+------------------+
||                                          ProcessorFeatures                                          ||
|+-------------------------------------------------------------------+---------------------------------+|
||                               Title                                |              Worth              ||
|+-------------------------------------------------------------------+---------------------------------+|
||  coreCount                                                        |  8                              ||
||  threadsPerCore                                                   |  1                              ||
|+-------------------------------------------------------------------+---------------------------------+|

TimeStamp-3: Modifying occasion processor characteristic settings

Now, we run the next command to switch the occasion’s processor characteristic settings to 4 cores and 1 thread per core:

aws rds modify-db-instance --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance-8  
--db-instance-class db.r7i.8xlarge 
--processor-features "Title=coreCount,Worth=4" "Title=threadsPerCore,Worth=1" 
--apply-immediately

We describe the occasion:

aws rds describe-db-instances --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance-8 
--query 'DBInstances[].{DBInstanceIdentifier:DBInstanceIdentifier,Engine:Engine,EngineVersion:EngineVersion,ProcessorFeatures:ProcessorFeatures,DBInstanceClass:DBInstanceClass}'

We get the next output:

-----------------------------------------------------------------------------------
|                                DescribeDBInstances                               |
+-----------------+----------------------------+---------------+-------------------+
| DBInstanceClass |   DBInstanceIdentifier     |    Engine     |   EngineVersion   |
+-----------------+----------------------------+---------------+-------------------+
|  db.r7i.8xlarge |  rfs-test-ocpu-instance-8  |  sqlserver-ee |  16.00.4215.2.v1  |
+-----------------+----------------------------+---------------+-------------------+
||                                ProcessorFeatures                               ||
|+-----------------------------------------------------+--------------------------+|
||                        Title                         |          Worth           ||
|+-----------------------------------------------------+--------------------------+|
||  coreCount                                          |  4                       ||
||  threadsPerCore                                     |  1                       ||
|+-----------------------------------------------------+--------------------------+|

TimeStamp-4: PITR to newest restorable time

Subsequent, we restore the occasion to the most recent restorable time.

aws rds restore-db-instance-to-point-in-time --region us-west-2 
--vpc-security-group-ids sg-XXXXX 
--db-subnet-group-name rds-db-sub-net-group-xxx 
--publicly-accessible 
--source-db-instance-identifier rfs-test-ocpu-instance-8 
--target-db-instance-identifier rfs-test-ocpu-instance-9 
--use-latest-restorable-time

We run the describe command on the restored occasion:

aws rds describe-db-instances --region us-west-2 
--db-instance-identifier rfs-test-ocpu-instance-9 
--query 'DBInstances[].{DBInstanceIdentifier:DBInstanceIdentifier,Engine:Engine,EngineVersion:EngineVersion,ProcessorFeatures:ProcessorFeatures,DBInstanceClass:DBInstanceClass}' 

We get the next output:

------------------------------------------------------------------------------------
|                                DescribeDBInstances                               |
+-----------------+----------------------------+---------------+-------------------+
| DBInstanceClass |   DBInstanceIdentifier     |    Engine     |   EngineVersion   |
+-----------------+----------------------------+---------------+-------------------+
|  db.r7i.8xlarge |  rfs-test-ocpu-instance-9  |  sqlserver-ee |  16.00.4215.2.v1  |
+-----------------+----------------------------+---------------+-------------------+
||                                ProcessorFeatures                               ||
|+-----------------------------------------------------+--------------------------+|
||                        Title                         |          Worth           ||
|+-----------------------------------------------------+--------------------------+|
||  coreCount                                          |  8                       ||
||  threadsPerCore                                     |  1                       ||
|+-----------------------------------------------------+--------------------------+||

On the time of Level-in-Time Restore (PITR) the supply occasion is operating on a db.r7i.8xlarge occasion sort, that includes 4 cores and 1 thread per core. Nevertheless, the restored occasion’s (utilizing the most recent restorable time) CPU settings are derived from the snapshot utilizing 8 cores and 1 thread per core.

Clear up

Should you not want your RDS for SQL Server occasion, delete it to keep away from incurring extra prices.

Conclusion

On this publish, we demonstrated the right way to use the Optimize CPU characteristic on Amazon RDS for SQL Server to customise vCPU allocation, probably lowering prices and optimizing efficiency on your particular workloads. We lined creating new cases, modifying present ones, and performing snapshot restores and point-in-time recoveries with Optimize CPU settings. By fine-tuning your CPU assets, you may obtain higher value optimization whereas sustaining the efficiency your functions require. We encourage you to check out this characteristic on your use circumstances and share your experiences within the feedback beneath.

For extra details about Amazon RDS for SQL Server and its options, seek advice from the Amazon RDS Consumer Information.


Concerning the authors

Srikanth Katakam

Srikanth Katakam

Srikanth is a Senior Database Engineer at AWS, specialised in Amazon RDS business database engines corresponding to Amazon RDS managed and Amazon RDS Customized for SQL Server. With a wealth of technical experience, Srikanth is obsessed with designing and creating sturdy options that serve the various wants of AWS clients.

Sandesh Bhandari

Sandesh Bhandari

Sandesh is a Software program Improvement Engineer at AWS, engaged on Amazon RDS for SQL Server and RDS Customized for SQL Server. He focuses on constructing scalable database options and tackling advanced technical issues. With a deal with detailed evaluation and innovation, Sandesh develops options that improve the reliability and effectivity of AWS database providers.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles