• 沒有找到結果。

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:

• Creating an Amazon RDS DB instance (p. 174)

• Modifying an Amazon RDS DB instance (p. 308)

• Restoring from a DB snapshot (p. 431)

• Restoring a DB instance to a specified time (p. 479)

• Restoring a backup into a MySQL DB instance (p. 1178)

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

Configuring the processor

You can set the CPU cores and the threads per CPU core for a DB instance class using the AWS Management Console, the AWS CLI, or the RDS API.

Console

When you are creating, modifying, or restoring a DB instance, you set the DB instance class in the AWS Management Console. The Instance specifications section shows options for the processor. The following image shows the processor features options.

Configuring the processor

Configuring the processor

Set the following options to the appropriate values for your DB instance class under Processor features:

Core count – Set the number of CPU cores using this option. The value must be equal to or less than the maximum number of CPU cores for the DB instance class.

Threads per core – Specify 2 to enable multiple threads per core, or specify 1 to disable multiple threads per core.

When you modify or restore a DB instance, you can also set the CPU cores and the threads per CPU core to the defaults for the instance class.

When you view the details for a DB instance in the console, you can view the processor information for its DB instance class on the Configuration tab. The following image shows a DB instance class with one CPU core and multiple threads per core enabled.

For Oracle DB instances, the processor information only appears for Bring Your Own License (BYOL) DB instances.

AWS CLI

You can set the processor features for a DB instance when you run one of the following AWS CLI commands:

• create-db-instance

Configuring the processor

• modify-db-instance

• restore-db-instance-from-db-snapshot

• restore-db-instance-from-s3

• restore-db-instance-to-point-in-time

To configure the processor of a DB instance class for a DB instance by using the AWS CLI, include the --processor-features option in the command. Specify the number of CPU cores with the coreCount feature name, and specify whether multiple threads per core are enabled with the threadsPerCore feature name.

The option has the following syntax.

--processor-features "Name=coreCount,Value=<value>" "Name=threadsPerCore,Value=<value>"

The following are examples that configure the processor:

Examples

• Setting the number of CPU cores for a DB instance (p. 40)

• Setting the number of CPU cores and disabling multiple threads for a DB instance (p. 40)

• Viewing the valid processor values for a DB instance class (p. 41)

• Returning to default processor settings for a DB instance (p. 42)

• Returning to the default number of CPU cores for a DB instance (p. 42)

• Returning to the default number of threads per core for a DB instance (p. 43)

Setting the number of CPU cores for a DB instance Example

The following example modifies mydbinstance by setting the number of CPU cores to 4. The changes are applied immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

For Linux, macOS, or Unix:

aws rds modify-db-instance \

--processor-features "Name=coreCount,Value=4" \ --apply-immediately

For Windows:

aws rds modify-db-instance ^

--processor-features "Name=coreCount,Value=4" ^ --apply-immediately

Setting the number of CPU cores and disabling multiple threads for a DB instance Example

The following example modifies mydbinstance by setting the number of CPU cores to 4 and disabling multiple threads per core. The changes are applied immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

Configuring the processor

For Linux, macOS, or Unix:

aws rds modify-db-instance \

--processor-features "Name=coreCount,Value=4" "Name=threadsPerCore,Value=1" \ --apply-immediately

For Windows:

aws rds modify-db-instance ^

--processor-features "Name=coreCount,Value=4" "Name=threadsPerCore,Value=1" ^ --apply-immediately

Viewing the valid processor values for a DB instance class Example

You can view the valid processor values for a particular DB instance class by running the describe-orderable-db-instance-options command and specifying the instance class for the --db-instance-class option. For example, the output for the following command shows the processor options for the db.r3.large instance class.

aws rds describe-orderable-db-instance-options --engine oracle-ee --db-instance-class db.r3.large

Following is sample output for the command in JSON format.

{

Configuring the processor

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

• describe-db-instances – Shows the processor information for the specified DB instance.

• describe-db-snapshots – Shows the processor information for the specified DB snapshot.

• describe-valid-db-instance-modifications – Shows the valid modifications to the processor for the specified DB instance.

In the output of the preceding commands, the values for the processor features are not null only if the following conditions are met:

• You are using an Oracle DB instance.

• Your Oracle DB instance supports changing processor values.

• The current CPU core and thread settings are set to nondefault values.

If the preceding conditions aren't met, you can get the instance type using describe-db-instances. You can get the processor information for this instance type by running the EC2 operation describe-instance-types.

Returning to default processor settings for a DB instance Example

The following example modifies mydbinstance by returning its DB instance class to the default processor values for it. The changes are applied immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

For Linux, macOS, or Unix:

aws rds modify-db-instance \

--use-default-processor-features \ --apply-immediately

For Windows:

aws rds modify-db-instance ^

--use-default-processor-features ^ --apply-immediately

Returning to the default number of CPU cores for a DB instance Example

The following example modifies mydbinstance by returning its DB instance class to the default number of CPU cores for it. The threads per core setting isn't changed. The changes are applied immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

Configuring the processor

For Linux, macOS, or Unix:

aws rds modify-db-instance \

--processor-features "Name=coreCount,Value=DEFAULT" \ --apply-immediately

For Windows:

aws rds modify-db-instance ^

--processor-features "Name=coreCount,Value=DEFAULT" ^ --apply-immediately

Returning to the default number of threads per core for a DB instance Example

The following example modifies mydbinstance by returning its DB instance class to the default number of threads per core for it. The number of CPU cores setting isn't changed. The changes are applied immediately by using --apply-immediately. If you want to apply the changes during the next scheduled maintenance window, omit the --apply-immediately option.

For Linux, macOS, or Unix:

aws rds modify-db-instance \

--processor-features "Name=threadsPerCore,Value=DEFAULT" \ --apply-immediately

For Windows:

aws rds modify-db-instance ^

--processor-features "Name=threadsPerCore,Value=DEFAULT" ^ --apply-immediately

RDS API

You can set the processor features for a DB instance when you call one of the following Amazon RDS API operations:

To configure the processor features of a DB instance class for a DB instance by using the Amazon RDS API, include the ProcessFeatures parameter in the call.

The parameter has the following syntax.

ProcessFeatures "Name=coreCount,Value=<value>" "Name=threadsPerCore,Value=<value>"

Specify the number of CPU cores with the coreCount feature name, and specify whether multiple threads per core are enabled with the threadsPerCore feature name.

You can view the valid processor values for a particular instance class by running the DescribeOrderableDBInstanceOptions operation and specifying the instance class for the DBInstanceClass parameter. You can also use the following operations:

相關文件