開啟和關閉 Aurora 的效能詳情 - Amazon Aurora

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

開啟和關閉 Aurora 的效能詳情

您可以在建立資料庫叢集時開啟績效詳情。如有需要,您可以稍後從主控台修改資料庫叢集將其關閉。開啟和關閉績效詳情不會造成停機、重新開機或容錯移轉。

注意

效能結構描述為 Aurora MySQL 使用的選用效能工具。若您開啟或關閉「效能架構」,則需要重新開機。然而,如果您開啟或關閉績效詳情,則無需重新開機。如需詳細資訊,請參閱Aurora MySQL 上效能詳情的效能結構描述概觀

如果您搭配 Aurora 全域資料庫使用績效詳情,請個別開啟每個資料庫的績效詳情 AWS 區域。如需詳細資訊,請參閱 使用 Amazon RDS Performance Insights 監控 Amazon Aurora 全域資料庫

績效詳情代理程式會耗用資料庫主機上有限的 CPU 和記憶體。當資料庫負載過高時,代理程式會減少收集資料的頻率來限制效能影響。

Console

在主控台中,您可以在建立資料庫叢集時啟用或關閉 Performance Insights。在叢集層級啟用績效詳情可讓您在叢集層級管理績效詳情設定和選項。叢集層級設定會套用至叢集的所有資料庫執行個體。

在建立時,開啟或關閉績效詳情

建立新的資料庫叢集之後,請在績效詳情區段中選擇啟用績效詳情,以開啟績效詳情在叢集層級啟用績效詳情適用於叢集中的所有資料庫執行個體。 取消選取選項,以在叢集層級關閉績效詳情。

若要建立資料庫叢集,請遵循 中資料庫引擎的指示建立 Amazon Aurora 資料庫叢集

下列螢幕擷取畫面顯示 Performance Insights (績效詳情) 區段。

使用主控台建立資料庫叢集期間開啟績效詳情。

若您選擇 Enable Performance Insights (啟用績效詳情),會有下列選項:

  • Retention (保留) – 保留績效詳情資料的時間。免費方案中的保留設定為 Default (7 days) (預設值 (7 天))。若要更長時間保留績效資料,請指定 1 - 24 個月。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留

  • AWS KMS key – 指定您的 AWS KMS key。績效詳情使用您的 KMS 金鑰來加密所有可能的敏感資料。將會對傳輸中與靜態資料進行加密。如需詳細資訊,請參閱變更效 Per AWS KMS formance Insights 的原則

修改資料庫叢集時,開啟或關閉績效詳情

在 主控台中,您可以修改資料庫叢集,以管理績效詳情。

使用主控台管理的效能詳情
  1. 登入 AWS Management Console ,並在 https://console.aws.amazon.com/rds/:// 開啟 Amazon RDS 主控台。

  2. 選擇 Databases (資料庫)。

  3. 選擇資料庫叢集,然後選擇修改

  4. 績效詳情區段中,選取啟用績效詳情或取消選取選項以停用績效詳情。

    若您選擇 Enable Performance Insights (啟用績效詳情),會有下列選項:

    • Retention (保留) – 保留績效詳情資料的時間。免費方案中的保留設定為 Default (7 days) (預設值 (7 天))。若要更長時間保留績效資料,請指定 1 - 24 個月。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留

    • AWS KMS key – 指定您的 KMS 金鑰。績效詳情使用您的 KMS 金鑰來加密所有可能的敏感資料。將會對傳輸中與靜態資料進行加密。如需詳細資訊,請參閱加密 Amazon Aurora 資源

    使用主控台在資料庫叢集修改期間修改績效詳情。
  5. 選擇 Continue (繼續)。

  6. Scheduling of Modifications (修改排程) 中,選擇 Apply immediately (立即套用)。如果您選擇 Apply during the next scheduled maintenance window (在下一個排定的維護時段套用),則執行個體會忽略此設定,並立即開啟 Performance Insights。

  7. 選擇 Modify instance (修改執行個體)

AWS CLI

當您使用 create-db-instance AWS CLI 命令時,請指定 來開啟績效詳情--enable-performance-insights。或者透過指定 --no-enable-performance-insights 來關閉 Performance Insights。

您也可以使用下列 AWS CLI 命令來指定這些值:

使用 管理資料庫叢集的效能詳情 AWS CLI
  • 呼叫 modify-db-cluster AWS CLI 命令並提供下列值:

    • --db-cluster-identifier資料庫叢集中的資料庫執行個體名稱。

    • --enable-performance-insights 用來開啟,--no-enable-performance-insights 用來關閉

    以下範例會開啟 sample-db-cluster 的 Performance Insights。

    對於 Linux、 macOS或 Unix:

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

    在 Windows 中:

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

當您開啟績效詳情時,可選擇使用 --performance-insights-retention-period 選項指定保留績效詳情資料的天數。您可指定為 7 * 31 (其中是指 1 - 23) 的數字,或 731。例如,如果您想要保留效能資料 3 個月,請指定 93,也就是 3 個 * 31。預設值是 7 天。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留

下列範例會開啟 sample-db-cluster 的 Performance Insights,並指定 Performance Insights 資料保留 93 天 (3 個月)。

對於 Linux、 macOS或 Unix:

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

在 Windows 中:

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

如果您指定保留期間 (例如 94 天),這不是有效值,RDS 就會發出錯誤。

An error occurred (InvalidParameterValue) when calling the CreateDBInstance operation: Invalid Performance Insights retention period. Valid values are: [7, 31, 62, 93, 124, 155, 186, 217, 248, 279, 310, 341, 372, 403, 434, 465, 496, 527, 558, 589, 620, 651, 682, 713, 731]
注意

您只能在資料庫叢集中切換 Performance Insights,其中 Performance Insights 未在叢集層級管理。

RDS API

當您使用 CreateDBInstance 作業 Amazon RDS API 作業來建立資料庫叢集中新的資料庫執行個體時,請將 EnablePerformanceInsights 設為 True 以開啟績效詳情。若要關閉績效詳情,請將 EnablePerformanceInsights 設定為 False

您也可以使用下列 API 操作來指定 EnablePerformanceInsights 值:

當您開啟 Performance Insights 時,可以使用 PerformanceInsightsRetentionPeriod 參數來選擇保留 Performance Insights 資料的時間 (以天數為單位)。您可指定為 7 * 31 (其中是指 1 - 23) 的數字,或 731。例如,如果您想要保留效能資料 3 個月,請指定 93,也就是 3 個 * 31。預設值是 7 天。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留