跳至內容

如何對 Aurora 叢集和執行個體的 Performance Insights 與 CloudWatch Database Insights 問題進行疑難排解?

2 分的閱讀內容
0

我已為 Amazon Aurora MySQL 相容版本叢集啟用 Performance Insights 或 Amazon CloudWatch Database Insights,但我遇到了一些問題。我想在 Performance Insights 或 CloudWatch Database Insights 中查看資料。

簡短描述

重要:Performance Insights 將於 2026 年 6 月 30 日終止服務。您可以在 2026 年 6 月 30 日之前升級至 Database Insights 的進階模式。如果不升級,則使用 Performance Insights 的資料庫叢集將預設為 Database Insights 的標準模式。只有 Database Insights 的進階模式才支援執行計畫和隨需分析。如果您的叢集預設為標準模式,那麼您可能無法在主控台上使用這些功能。若要開啟進階模式,請參閱為 Amazon RDS 開啟 Database Insights 進階模式 與 為 Amazon Aurora 開啟 Database Insights 進階模式。

如果您未正確設定 Performance Insights 與 Database Insights 的元件,可能會遇到問題。

以下元件可能會導致問題:

  • Aurora 版本與 AWS 區域可用性
  • 執行個體型別
  • AWS Identity and Access Management (IAM) 政策
  • MySQL Performance Schema
  • SQL 文字配額
  • 資源使用率
  • 資料庫執行個體的暫時性網路問題或系統維護
  • 資料庫執行個體的資料庫負載低於閾值

解決方法

Aurora 版本與區域可用性

依據您的平行查詢組態,您的引擎版本與 AWS 區域可能不支援 Performance Insights 與 Database Insights。

如果您關閉平行查詢,則所有 Aurora MySQL-Compatible 2 與 Aurora MySQL-Compatible 3 叢集的版本可在所有區域使用。

如果您開啟平行查詢,則所有 Aurora MySQL 2 的版本僅可在亞太區域 (海德拉巴) 區域使用。其他區域僅提供版本 2.09.0 及更新版本。Aurora MySQL 相容版本 3 無法使用。

您只能在特定區域查看 Performance Insights 主動建議。若要查看支援區域清單,請參閱支援 Performance Insights 功能的 Amazon Aurora 資料庫引擎、區域與執行個體類別。

除了中國 (北京) 與中國 (寧夏) 區域外,所有區域皆支援 Database Insights。如需詳細資訊,請參閱支援 Database Insights 功能的 Amazon Aurora 資料庫引擎、區域與執行個體類別。

執行個體型別

以下資料庫執行個體類別不支援 Performance Insights 與 Database Insights:

  • db.t2
  • db.t3
  • db.t4g.micro 與 db.t4g.small

您無法在 db.serverless 執行個體類別上分析特定期間的資料庫效能或查看 Performance Insights 主動建議。

IAM 政策

以下為使用 IAM 政策存取 Performance Insights 的常見範例:

若要存取 Database Insights,必須使用以下開放存取權限:

  • cloudwatch:*
  • logs:*
  • rds:*
  • pi:*

**注意:**最佳實務是遵循最低權限原則。如需詳細資訊,請參閱 Database Insights 的必要權限。

MySQL Performance Schema

Performance Schema 是 MySQL 的選擇性功能,可監控內部事件,且對效能影響最小。

Performance Schema 監控的指標類型取決於您設定的管理模式:

  • 若將 Performance Schema 設為 ON (自動管理模式),則可取得詳細的低階指標。
  • 若將 Performance Schema 設為 ON (手動管理模式),則可取得部分詳細指標。
  • 若將 Performance Schema 設為 OFF (無管理模式),則無法取得等待事件報告,只能存取基本指標。

如果無法在 Performance Insights 儀表板查看詳細低階指標,請重設以下參數,並將來源欄設為引擎預設:

  • performance_schema=1
  • performance-schema-consumer-events-waits-current=ON
  • performance-schema-instrument: wait/%=ON
  • performance_schema_consumer_global_instrumentation=ON
  • performance_schema_consumer_thread_instrumentation=ON

如需更多資訊,請參閱 Aurora MySQL Performance Insights 的 Performance Schema 概觀。

SQL 文字配額

Performance Insights 儀表板對最大文字大小有配額限制。如果您的文字超出配額,那麼您無法在 Performance Insights 儀表板上查看整個查詢。若要解決此問題,請縮小文字大小。

資源使用率

若資料庫執行個體負載過重,叢集會將資源分配給資料庫程序。因此,叢集會降低系統程序 (如 Performance Insights) 的優先順序。若要檢查資料庫執行個體是否負載過重,請查看 CPU 使用率 與 FreeableMemory CloudWatch 指標。

若要解決此問題,請執行下列動作:

資料庫執行個體的暫時性網路問題或系統維護

當資料庫執行個體遇到暫時性網路問題或系統維護時,Performance Insights 可能無法正確報告資料。若要對受影響的資源進行疑難排解,請檢查 AWS Health 儀表板。

無法查看 Performance Insights 資料

如果啟用 Performance Insights 後無法查看資料,請檢查 Performance Insights 儀表板上的資料庫負載圖表及計數器指標。如果計數器指標有資料,但資料庫負載圖表無資料,則您的資料庫負載可能低於 MySQL 的資料庫負載閾值。

若要測試此問題,請在您的 MySQL 資料庫執行個體上執行長時間交易,然後再次檢查 Performance Insights 儀表板。如果有顯示資料,則表示原始資料庫負載低於閾值。

若要解決此問題,請在檢查 Performance Insights 儀表板前,先等待資料庫負載增加。隨著資料庫負載隨時間增加,儀表板的資料會逐漸顯示。

相關資訊

使用 Performance Insights 分析 Amazon RDS 資料庫工作負載

在 Amazon RDS for Microsoft SQL Server 上使用 Performance Insights 監控查詢效能

Performance Insights 常見問題

在 Amazon Aurora 上使用 Performance Insights 監控資料庫負載

AWS 官方已更新 1 年前