Enabling Performance Insights - Amazon Relational Database Service

Enabling Performance Insights

To use Performance Insights, you must enable it on your DB instance. Enabling and disabling Performance Insights doesn't cause downtime, a reboot, or a failover.

The Performance Insights agent consumes limited CPU and memory on the DB host. When the DB load is high, the agent limits the performance impact by collecting data less frequently.

You can use the console to enable Performance Insights when you create a new DB instance. You can also modify a DB instance to enable Performance Insights.

Enabling Performance Insights with the Console When Creating a DB Instance

When you create a new DB instance, Performance Insights is enabled when you choose Enable Performance Insights in the Performance Insights section.

To create a DB instance, follow the instructions for your DB engine in Creating an Amazon RDS DB Instance.

The following screenshot shows the Performance Insights section.


							Enable Performance Insights during DB instance creation with
								console

You have the following options when you choose Enable Performance Insights:

  • Retention – The amount of time to retain Performance Insights data. Choose either 7 days (the default) or 2 years.

  • Master key – Specify your AWS Key Management Service (AWS KMS) key. Performance Insights encrypts all potentially sensitive data using your AWS KMS key. Data is encrypted in flight and at rest. For more information, see Encrypting Amazon RDS Resources.

Enabling Performance Insights with the Console When Modifying a DB Instance

You can modify a DB instance to enable Performance Insights using the console.

To enable Performance Insights for a DB instance using the console

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose Databases.

  3. Choose the DB instance that you want to modify, and choose Modify.

  4. In the Performance Insights section, choose Enable Performance Insights.

    You have the following options when you choose Enable Performance Insights:

    • Retention – The amount of time to retain Performance Insights data. Choose either 7 days (the default) or 2 years.

    • Master key – Specify your AWS Key Management Service (AWS KMS) key. Performance Insights encrypts all potentially sensitive data using your AWS KMS key. Data is encrypted in flight and at rest. For more information, see Encrypting Amazon RDS Resources.

  5. Choose Continue.

  6. For Scheduling of Modifications, choose one of the following:

    • Apply during the next scheduled maintenance window – Wait to apply the Performance Insights modification until the next maintenance window.

    • Apply immediately – Apply the Performance Insights modification as soon as possible.

  7. Choose Modify instance.

When you create a new DB instance using the create-db-instance AWS CLI command, Performance Insights is enabled when you specify --enable-performance-insights.

You can also specify the --enable-performance-insights value using the following AWS CLI commands:

The following procedure describes how to enable Performance Insights for a DB instance using the AWS CLI.

To enable Performance Insights for a DB instance using the AWS CLI

  • Call the modify-db-instance AWS CLI command and supply the following values:

    • --db-instance-identifier – The name of the DB instance.

    • --enable-performance-insights

    The following example enables Performance Insights for sample-db-instance.

    For Linux, macOS, or Unix:

    aws rds modify-db-instance \ --db-instance-identifier sample-db-instance \ --enable-performance-insights

    For Windows:

    aws rds modify-db-instance ^ --db-instance-identifier sample-db-instance ^ --enable-performance-insights

When you enable Performance Insights, you can optionally specify the amount of time, in days, to retain Performance Insights data with the --performance-insights-retention-period option. Valid values are 7 (the default) or 731 (2 years).

The following example enables Performance Insights for sample-db-instance and specifies that Performance Insights data is retained for two years.

For Linux, macOS, or Unix:

aws rds modify-db-instance \ --db-instance-identifier sample-db-instance \ --enable-performance-insights \ --performance-insights-retention-period 731

For Windows:

aws rds modify-db-instance ^ --db-instance-identifier sample-db-instance ^ --enable-performance-insights ^ --performance-insights-retention-period 731

When you create a new DB instance using the CreateDBInstance operation Amazon RDS API operation, Performance Insights is enabled when you set EnablePerformanceInsights to True.

You can also specify the EnablePerformanceInsights value using the following API operations:

When you enable Performance Insights, you can optionally specify the amount of time, in days, to retain Performance Insights data with the PerformanceInsightsRetentionPeriod parameter. Valid values are 7 (the default) or 731 (2 years).

Enabling the Performance Schema for Performance Insights on Amazon RDS for MariaDB or MySQL

When the Performance Schema feature is enabled for Amazon RDS for MariaDB or MySQL, Performance Insights provides more detailed information. For example, Performance Insights displays DB load categorized by detailed wait events. Without the Performance Schema enabled, Performance Insights displays DB load categorized by the list state of the MySQL process.

The Performance Schema is enabled automatically when you create an Amazon RDS for MariaDB or MySQL DB instance with Performance Insights enabled. In this case, Performance Insights automatically manages the parameters in the following table.

Parameter Name

Parameter Value

performance_schema 1 (the source parameter is set to engine-default)
performance-schema-consumer-events-waits-current ON
performance-schema-instrument wait/%=ON
performance-schema-consumer-global-instrumentation ON
performance-schema-consumer-thread-instrumentation ON
Important

When Performance Schema is enabled automatically, Performance Insights changes schema-related parameters on the DB instance. These changes aren't visible in the parameter group associated with the DB instance.

Enabling the Performance Schema Manually

Performance Schema is not enabled when both the following conditions are true:

  • The performance_schema parameter is set to 0 or 1.

  • The performance_schema parameter source is set to user.

To enable the Performance Schema manually

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. Choose Parameter groups.

  3. Select the parameter group for your DB instance.

  4. Select the performance_schema parameter.

  5. Select Edit parameters.

  6. Select Reset.

  7. Select Reset parameters.

  8. Restart the DB instance.

For more information about modifying instance parameters, see Modifying Parameters in a DB Parameter Group. For more information about the dashboard, see Monitoring with the Performance Insights Dashboard. For more information about the MySQL performance schema, see MySQL 8.0 Reference Manual.