启用和禁用 Performance Insights - Amazon DocumentDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

启用和禁用 Performance Insights

要使用 Performance Insights,请在数据库实例中启用它。如果需要,您可以稍后将其禁用。启用和禁用 Performance Insights 不会导致停机、重新启动或故障转移。

Performance Insights 代理占用数据库主机上有限的 CPU 和内存。当数据库负载较高时,代理将通过降低收集数据的频率来限制性能影响。

在创建集群时启用 Performance Insights

在控制台中,您可以在创建或修改新数据库实例时启用或禁用 Performance Insights。

使用 Amazon Web Services Management Console

在控制台中,您可以在创建 DocumentDB 集群时启用 Performance Insights。在创建新 DocumentDB 集群时,通过在 Performance Insights 部分中选择启用 Performance Insights 以启用 Performance Insights。

控制台说明
  1. 有关创建集群的说明,请参阅创建 Amazon DocumentDB 集群中的说明。

  2. 在 Performance Insights 部分中选择启用 Performance Insights

    注意

    Performance Insights 的数据留存期将为七天。

    Amazon KMS 密钥 — 指定您的 Amazon KMS 密钥。Performance Insights 使用您的 Amazon KMS 密钥来加密所有潜在的敏感数据。正在传输的数据和静态数据都会被加密。有关更多信息,请参阅为 Performance Insights 配置 Amazon Amazon KMS 策略。

修改实例时启用和禁用

您也可以修改数据库实例以使用控制台或 Amazon CLI 启用或禁用 Performance Insights。

Using the Amazon Web Services Management Console
控制台说明
  1. 登录到 Amazon Web Services Management Console 并打开 Amazon DocumentDB 控制台,网址:https://console.aws.amazon.com/docdb

  2. 选择 Clusters (集群)

  3. 选择一个数据库实例,然后选择修改

  4. 在 Performance Insights 部分,选择启用 Performance Insights禁用 Performance Insights

    注意

    如果选择启用 Performance Insights,则可以指定 Amazon Amazon KMS 密钥。Performance Insights 使用您的 Amazon KMS 密钥来加密所有潜在的敏感数据。正在传输的数据和静态数据都会被加密。有关更多信息,请参阅加密 Amazon DocumentDB 静态数据

  5. 选择继续

  6. 对于修改计划,选择立即应用。如果您选择在下一个计划的维护时段内应用,则您的实例将忽略此设置并立即启用 Performance Insights。

  7. 选择修改实例

Using the Amazon CLI

使用 create-db-instancemodify-db-instance Amazon Amazon CLI 命令时,您可以通过指定 --enable-performance-insights 来启用 Performance Insights,也可以通过指定 --no-enable-performance-insights 将其禁用。

以下过程介绍如何使用 Amazon Amazon CLI 为数据库实例启用或禁用 Performance Insights。

AmazonAmazon CLI 说明

调用 modify-db-instance Amazon Amazon CLI 命令并提供以下值:

  • --db-instance-identifer — 数据库实例的名称

  • --enable-performance-insights 以启用,或 --no-enable-performance-insights 以禁用

以下示例为 sample-db-instance 启用 Performance Insights:

For Linux, macOS, or Unix:For Windows:
For Linux, macOS, or Unix:
aws docdb modify-db-instance \ --db-instance-identifier sample-db-instance \ --enable-performance-insights
For Windows:
aws docdb modify-db-instance ^ --db-instance-identifier sample-db-instance ^ --enable-performance-insights