View a markdown version of this page

Setting the CPU cores and threads per CPU core for a DB instance class - Amazon Relational Database Service

Setting the CPU cores and threads per CPU core for a DB instance class

You can configure the number of CPU cores and threads per core for the DB instance class when you perform the following operations:

Note

When you modify a DB instance to configure the number of CPU cores or threads per core, there is a brief outage similar to when you modify the instance class.

Set the CPU cores by using the AWS Management Console, the AWS CLI, AWS Tools for PowerShell, or the Amazon RDS API. The AWS CLI and AWS Tools for PowerShell come preinstalled in AWS CloudShell.

The Optimize CPU settings are the ProcessorFeature values coreCount and threadsPerCore. The processor feature values are null if Optimize CPU is not configured.

To set the processor features when you create a DB instance
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose Create database.

  3. When setting the Instance configuration options:

    1. Under Optimize CPU, select Configure the number of vCPUs.

    2. Under vCPUs, choose the number of thread(s) per CPU core and the number of core(s). The lists show the valid values for the selected instance class. For more information, see DB instance classes that support Optimize CPU.

    Database create page when setting OCPU settings.
  4. After completing other selections, choose Create database.

To view the processor features of a DB instance
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Databases, and then choose the DB instance.

  3. Choose the Configuration tab.

  4. Under Processor Features, view the vCPU, Core count, and Threads per core values.

To modify the processor features of a DB instance
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Databases, and then choose the DB instance that you want to modify.

  3. Choose Modify.

  4. For Optimize CPU, choose Configure the number of vCPUs.

  5. Under vCPUs, choose the number of thread(s) per CPU core and the number of core(s). The lists show the valid values for the selected instance class. For more information, see DB instance classes that support Optimize CPU.

  6. Choose Continue.

  7. For When to apply modifications, choose Apply during the next scheduled maintenance window or Apply immediately.

  8. Choose Modify DB instance.

To return a DB instance to the default processor features
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Databases, and then choose the DB instance that you want to modify.

  3. Choose Modify.

  4. For Optimize CPU, choose Use default vCPUs.

  5. Choose Continue.

  6. For When to apply modifications, choose Apply during the next scheduled maintenance window or Apply immediately.

  7. Choose Modify DB instance.

To set the processor features when you create a DB instance
  1. To configure Optimize CPU using the AWS CLI, include the --processor-features option in the create-db-instance command. Specify the number of CPU cores with the coreCount and threadsPerCore as 1.

  2. Use the following syntax:

    aws rds create-db-instance \ --db-instance-identifier my-rds-instance \ --engine sqlserver-ee \ --engine-version 17.00 \ --license-model license-included \ --db-instance-class db.r8i.8xlarge \ --allocated-storage 300 \ --master-username admin \ --manage-master-user-password \ --no-multi-az \ --vpc-security-group-ids sg-0123456789abcdef0 \ --db-subnet-group-name mydbsubnetgroup \ --processor-features "Name=coreCount,Value=12" "Name=threadsPerCore,Value=1"
Example of viewing valid processor features for a DB instance class

Use the describe-orderable-db-instance-options command to show the default and allowed values.

aws rds describe-orderable-db-instance-options \ --engine sqlserver-ee \ --db-instance-class db.r8i.8xlarge \ --query "OrderableDBInstanceOptions[0].AvailableProcessorFeatures"

In addition, you can run the following commands for DB instance class processor information:

Example of setting the number of CPU cores for a DB instance

The following example uses the modify-db-instance command to modify my-rds-instance by setting the number of CPU cores to 12 and threadsPerCore to 1. Apply the changes immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

aws rds modify-db-instance \ --db-instance-identifier my-rds-instance \ --processor-features "Name=coreCount,Value=12" "Name=threadsPerCore,Value=1" \ --apply-immediately
Example of returning to default processor features for a DB instance

The following example uses the modify-db-instance command to modify my-rds-instance by returning it to the default processor features.

aws rds modify-db-instance \ --db-instance-identifier my-rds-instance \ --use-default-processor-features \ --apply-immediately
To set the processor features when you create a DB instance
  1. To configure Optimize CPU using AWS Tools for PowerShell, include the -ProcessorFeature parameter in the New-RDSDBInstance cmdlet. Specify the number of CPU cores with the coreCount and threadsPerCore as 1.

  2. Use the following syntax:

    New-RDSDBInstance ` -DBInstanceIdentifier my-rds-instance ` -Engine sqlserver-ee ` -EngineVersion 17.00 ` -LicenseModel license-included ` -DBInstanceClass db.r8i.8xlarge ` -AllocatedStorage 300 ` -MasterUsername admin ` -ManageMasterUserPassword $true ` -MultiAZ $false ` -VpcSecurityGroupId sg-0123456789abcdef0 ` -DBSubnetGroupName mydbsubnetgroup ` -ProcessorFeature @{Name='coreCount';Value='12'},@{Name='threadsPerCore';Value='1'}
Example of viewing valid processor features for a DB instance class

Use the Get-RDSOrderableDBInstanceOption cmdlet to show the default and allowed values.

Get-RDSOrderableDBInstanceOption ` -Engine sqlserver-ee ` -DBInstanceClass db.r8i.8xlarge | Select-Object -First 1 -ExpandProperty AvailableProcessorFeatures

In addition, you can run the following cmdlets for DB instance class processor information:

Example of setting the number of CPU cores for a DB instance

The following example uses AWS Tools for PowerShell and the Edit-RDSDBInstance cmdlet to modify my-rds-instance by setting the number of CPU cores to 12 and threadsPerCore to 1. If you want to apply the changes during the next scheduled maintenance window, omit the -ApplyImmediately parameter.

Edit-RDSDBInstance ` -DBInstanceIdentifier my-rds-instance ` -ProcessorFeature @{Name='coreCount';Value='12'},@{Name='threadsPerCore';Value='1'} ` -ApplyImmediately $true
Example of returning to default processor features for a DB instance

The following example uses AWS Tools for PowerShell and the Edit-RDSDBInstance cmdlet to modify my-rds-instance by returning it to the default processor features.

Edit-RDSDBInstance ` -DBInstanceIdentifier my-rds-instance ` -UseDefaultProcessorFeature $true ` -ApplyImmediately $true