運用 Cloud SQL Enterprise Plus 版本提升效能

Cloud SQL Enterprise Plus 版建議工具會分析每日執行個體指標,找出可解決工作負載瓶頸或維護延遲問題的正式環境 Cloud SQL 執行個體。根據這些洞察資訊,您可以升級執行個體,將維護停機時間縮短至近乎零、透過資料快取提高讀取處理量,或同時享有這兩項功能。您也可以在現有的 Cloud SQL Enterprise Plus 版本執行個體上啟用資料快取,加速讀取密集型工作負載。

定價

本頁面所述的建議工具皆屬於標準建議工具定價級別。

事前準備

您必須先完成下列步驟,才能查看建議和洞察資料:

  • 如要取得查看及使用洞察和建議的權限,請確認您具備必要的角色。
    Tasks 角色
    查看建議 下列其中一個角色:recommender.cloudsqlViewer 或 cloudsql.viewer。
    套用建議 下列其中一個角色:recommender.cloudsqlAdmin、cloudsql.editor 或 cloudsql.admin。
    如要進一步瞭解角色,請參閱「瞭解角色」和「授予 Identity and Access Management (IAM) 權限」。
  • 啟用 Recommender API (如果尚未啟用)。

    啟用 API 所需的角色

    如要啟用 API,您必須具備 serviceusage.services.enable 權限。如果您建立了專案,可能已透過擁有者角色 (roles/owner) 取得這項權限。否則,您可以透過 Service Usage 管理員角色 (roles/serviceusage.serviceUsageAdmin) 取得這項權限。瞭解如何授予角色。

    啟用 API

升級至 Cloud SQL Enterprise Plus 版本,執行維護作業時幾乎無須停機

Cloud SQL Enterprise Plus 版本的「幾乎無須停機即可維護」建議工具,可協助您偵測重要執行個體,以及在維護期間需要長時間停止運作或已延後維護的執行個體。這項工具會分析執行個體中繼資料和維護相關資料。

如果您的執行個體是正式環境執行個體,且在維護期間需要長時間停止運作,或維護作業已延遲,建議您升級至 Cloud SQL Enterprise Plus 版本,這樣執行個體在維護期間幾乎無須停機。建議每天都會產生。

列出幾乎無須停機的建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,列出升級至 Cloud SQL Enterprise Plus 版本的建議,以縮短維護停機時間。

控制台

如要列出升級至 Cloud SQL Enterprise Plus 版本的建議,請按照下列步驟操作:

  1. 前往「Cloud SQL 執行個體」頁面。

    前往「Cloud SQL Instances」(Cloud SQL 執行個體) 頁面

    在「Improve instance health by investigating issues and acting on recommendations」(調查問題並按照建議採取行動,增進執行個體健康) 橫幅中,按一下「Expand Details」(展開詳細資料)。

或者,請按照下列步驟操作:

  1. 前往「Active Assist」。另請參閱「使用建議功能尋找及套用建議」。

    前往「Active Assist」頁面

    詳情請參閱「建議中心入門指南」。

  2. 在「所有建議」資訊卡中,按一下「成效」。

gcloud

執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.PerformanceRecommender \
--filter=recommenderSubtype=UPGRADE_TO_ENTERPRISE_PLUS

更改下列內容:

  • PROJECT_ID:專案 ID。
  • LOCATION:區域,例如 us-central1。

API

呼叫 insights.list 方法,如下所示:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations

更改下列內容:

  • PROJECT_ID:專案 ID。
  • LOCATION:區域,例如 us-central1。

如果推薦工具偵測到可升級至 Cloud SQL Enterprise Plus 版本的執行個體,就會在表格中列出執行個體名稱、簡短建議、目前的機型、建議的機型、位置和上次重新整理日期。

查看洞察資料和詳細建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,查看可升級至 Cloud SQL Enterprise Plus 版本的執行個體洞察和詳細建議。

控制台

執行下列其中一個步驟:

  • 在「Performance Recommendations」(成效建議) 頁面中,依序點選「Performance recommendations」(成效建議) 資訊卡和「Not optimized with Enterprise Plus」(未透過 Enterprise Plus 最佳化)。系統會顯示建議面板,其中包含執行個體的深入分析和詳細建議。

  • 在「執行個體」頁面,按一下「未透過 Enterprise Plus 最佳化調整」。執行個體清單只會顯示適用建議的執行個體。

gcloud

執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.PerformanceInsight \
--filter=insightSubtype=INSIGHT_SUBTYPE

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:區域,例如 us-central1。
  • INSIGHT_SUBTYPE:將這個參數設為下列其中一項:
    • CRASH_RECOVERY_CAUSED_HIGH_MAINTENANCE_DOWNTIME:顯示執行個體當機復原總數的深入分析
    • MAINTENANCE_DEFERRED_MULTIPLE_TIMES:顯示執行個體延後維護總數的洞察資料

API

呼叫 insights.list 方法,如下所示:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights

更改下列內容:

  • PROJECT_ID:專案 ID。
  • LOCATION:區域,例如 us-central1。

畫面上會顯示面板,呈現「洞察」重點指標或資訊的相關洞察。

套用建議

如要採行這項建議,請按照下列步驟操作:

  • 如要升級至 Cloud SQL Enterprise Plus 版本,請按一下「問題」欄中的「未透過 Enterprise Plus 版本最佳化調整」。系統會顯示「升級至 Enterprise Plus 版本」視窗,並提供建議。如要繼續升級,請依序點選「編輯」>「升級」。如要進一步瞭解如何升級執行個體,請參閱「使用就地升級功能,將執行個體升級至 Cloud SQL Enterprise Plus 版本」。如要進一步瞭解零停機時間,請參閱「資料快取」。

升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,提高讀取效能

「升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,提高讀取效能」建議工具可協助您偵測重要且快取命中率偏低的執行個體。

「升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,提高讀取效能」建議工具會分析執行個體中繼資料和快取命中率指標。如果執行個體是正式環境執行個體,且快取命中率偏低,建議升級至 Cloud SQL Enterprise Plus 版本,並啟用資料快取,提高讀取效能。建議每天都會產生。

列出可升級至 Cloud SQL Enterprise Plus 版本的執行個體,並啟用資料快取,提高讀取效能建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,列出升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,以提升讀取效能的建議。

控制台

如要列出升級至 Cloud SQL Enterprise Plus 版本的建議,請按照下列步驟操作:

  1. 前往「Cloud SQL 執行個體」頁面。

    前往「Cloud SQL Instances」(Cloud SQL 執行個體) 頁面

    在「Improve instance health by investigating issues and acting on recommendations」(調查問題並按照建議採取行動,增進執行個體健康) 橫幅中,按一下「Expand Details」(展開詳細資料)。

或者,請按照下列步驟操作:

  1. 前往「Active Assist」。另請參閱「使用建議功能尋找及套用建議」。

    前往「Active Assist」頁面

    詳情請參閱「建議中心入門指南」。

  2. 在「所有建議」資訊卡中,按一下「成效」。

gcloud

如要列出升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,以提高讀取效能的建議,請執行 gcloud recommender recommendations list 指令,如下所示:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.PerformanceRecommender \
--filter=recommenderSubtype=UPGRADE_TO_ENTERPRISE_PLUS_AND_ENABLE_DATA_CACHE

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

API

如要列出升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,以提高讀取效能的建議,請呼叫 recommendations.list 方法,如下所示:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1。

如果推薦工具偵測到可升級至 Cloud SQL Enterprise Plus 版本的執行個體,就會在表格中列出執行個體名稱、簡短建議、目前的機型、建議的機型、位置和上次重新整理日期。

查看洞察資料和詳細建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,查看可升級至 Cloud SQL Enterprise Plus 版本的執行個體洞察和詳細建議。

控制台

執行下列其中一個步驟:

  • 在「Performance Recommendations」(成效建議) 頁面中,按一下「Performance recommendations」(成效建議) 資訊卡,然後點選「Not optimized with Enterprise Plus edition」(未針對 Enterprise Plus 版本進行最佳化)。

系統會顯示建議面板,其中包含執行個體的深入分析和詳細建議。

  • 在「Instances」(執行個體) 頁面,按一下「Not optimized with Enterprise Plus edition」(未透過 Enterprise Plus 版本最佳化調整)。

執行個體清單只會顯示適用建議的執行個體。

gcloud

如要查看可升級執行個體的洞察資料和詳細建議,請執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.PerformanceInsight \
--filter=insightSubtype=READ_HEAVY_WORKLOAD

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

API

呼叫 insights.list 方法,如下所示:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

畫面上會顯示面板,呈現「洞察」重點指標或資訊的相關洞察。

套用建議

如要採行這項建議,請按照下列步驟操作:

  • 如要升級至 Cloud SQL Enterprise Plus 版本,請按一下「Issues」(問題) 欄中的「Not optimized with Enterprise Plus edition」(未透過 Enterprise Plus 版本最佳化調整)。系統會顯示「升級至 Enterprise Plus 版本」視窗,並提供建議。如要繼續升級,請依序點選「編輯」>「升級」。如要進一步瞭解如何升級執行個體,請參閱「使用就地升級功能,將執行個體升級至 Cloud SQL Enterprise Plus 版本」。如要進一步瞭解零停機時間,請參閱「資料快取」。

升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取

升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取建議工具,即可偵測重要執行個體,以及在維護期間需要長時間停止或維護作業已延遲,且快取命中率偏低的執行個體。

啟用資料快取建議工具後,Cloud SQL Enterprise Plus 版本會分析執行個體中繼資料和指標。

如果您的執行個體是正式環境執行個體,且在維護期間需要長時間停止運作,或維護作業已延遲,且快取命中率偏低,建議您升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取,這樣執行個體在維護期間幾乎無須停機,且讀取效能也會提升。建議每天都會產生。

列出可升級至 Cloud SQL Enterprise Plus 版本,並啟用資料快取的 Cloud SQL 執行個體建議

使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API 啟用資料快取建議時,可以列出升級至 Cloud SQL Enterprise Plus 版本的建議。

控制台

如要列出升級至 Cloud SQL Enterprise Plus 版本的建議,請按照下列步驟操作:

  1. 前往「Cloud SQL 執行個體」頁面。

    前往「Cloud SQL Instances」(Cloud SQL 執行個體) 頁面

    在「Improve instance health by investigating issues and acting on recommendations」(調查問題並按照建議採取行動,增進執行個體健康) 橫幅中,按一下「Expand Details」(展開詳細資料)。

或者,請按照下列步驟操作:

  1. 前往「Active Assist」。另請參閱「使用建議功能尋找及套用建議」。

    前往「Active Assist」頁面

    詳情請參閱「建議中心入門指南」。

  2. 在「所有建議」資訊卡中,按一下「成效」。

gcloud

如要列出升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取的建議,請執行 gcloud recommender recommendations list 指令,如下所示:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.PerformanceRecommender \
--filter=recommenderSubtype=UPGRADE_TO_ENTERPRISE_PLUS_AND_ENABLE_DATA_CACHE

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

API

如要列出升級至 Cloud SQL Enterprise Plus 版本並啟用資料快取的建議,請呼叫 recommendations.list 方法,如下所示:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

如果推薦工具偵測到可升級至 Cloud SQL Enterprise Plus 版本的執行個體,並啟用資料快取,就會在表格中列出執行個體名稱、簡短建議、目前的機器類型、建議的機器類型、位置和上次重新整理日期。

查看洞察資料和詳細建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,查看可升級至 Cloud SQL Enterprise Plus 版本的執行個體洞察和詳細建議。

控制台

執行下列其中一個步驟:

  • 在「Performance Recommendations」(成效建議) 頁面中,依序點選「Performance recommendations」(成效建議) 資訊卡和「Not optimized with Enterprise Plus」(未透過 Enterprise Plus 最佳化)。系統會顯示建議面板,其中包含執行個體的深入分析和詳細建議。

  • 在「執行個體」頁面,按一下「未透過 Enterprise Plus 最佳化調整」。執行個體清單只會顯示適用建議的執行個體。

gcloud

如要查看可升級執行個體的洞察資料和詳細建議,請執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.PerformanceInsight \
--filter=insightSubtype=INSIGHT_SUBTYPE

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1
  • INSIGHT_SUBTYPE:將這個參數設為下列其中一項:
    • CRASH_RECOVERY_CAUSED_HIGH_MAINTENANCE_DOWNTIME:顯示執行個體當機復原總數的深入分析
    • MAINTENANCE_DEFERRED_MULTIPLE_TIMES:顯示執行個體延後維護總數的洞察資料
    • READ_HEAVY_WORKLOAD:顯示 CPU 使用率的深入分析

API

呼叫 insights.list 方法,如下所示:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights

更改下列內容:

  • PROJECT_ID:專案 ID。
  • LOCATION:區域,例如 us-central1。

畫面上會顯示面板,呈現「洞察」重點指標或資訊的相關洞察。

套用建議

如要採行這項建議,請按照下列步驟操作:

  • 如要升級至 Cloud SQL Enterprise Plus 版本,請按一下「問題」欄中的「未透過 Enterprise Plus 版本最佳化調整」。系統會顯示「升級至 Enterprise Plus 版本」視窗,並提供建議。如要繼續升級,請依序點選「編輯」>「升級」。如要進一步瞭解如何升級執行個體,請參閱「使用就地升級功能,將執行個體升級至 Cloud SQL Enterprise Plus 版本」。如要進一步瞭解資料快取,請參閱「資料快取」。如要進一步瞭解近乎零停機時間,請參閱這篇文章。

啟用資料快取,提高讀取效能

「啟用資料快取,提高讀取效能」建議工具可協助您偵測重要且快取命中率偏低的執行個體。

「啟用資料快取來提高讀取效能的 Cloud SQL Enterprise Plus 版本」建議工具會分析執行個體中繼資料和快取命中率指標。

如果執行個體是正式環境執行個體,且快取命中率偏低,建議啟用資料快取,提高讀取效能。建議每天都會產生。

列出符合「啟用資料快取,提高讀取效能」建議條件的 Cloud SQL 執行個體

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,列出啟用資料快取以提升讀取效能的建議。

控制台

如要列出升級至 Cloud SQL Enterprise Plus 版本的建議,請按照下列步驟操作:

  1. 前往「Cloud SQL 執行個體」頁面。

    前往「Cloud SQL Instances」(Cloud SQL 執行個體) 頁面

    在「Improve instance health by investigating issues and acting on recommendations」(調查問題並按照建議採取行動,增進執行個體健康) 橫幅中,按一下「Expand Details」(展開詳細資料)。

或者,請按照下列步驟操作:

  1. 前往「Active Assist」。另請參閱「使用建議功能尋找及套用建議」。

    前往「Active Assist」頁面

    詳情請參閱「建議中心入門指南」。

  2. 在「所有建議」資訊卡中,按一下「成效」。

gcloud

如要列出「啟用資料快取,提高讀取效能」建議,請執行 gcloud recommender recommendations list 指令,如下所示:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.PerformanceRecommender \
--filter=recommenderSubtype=ENABLE_DATA_CACHE

更改下列內容:

  • PROJECT_ID:您的專案 ID。
  • LOCATION:執行個體所在的區域,例如 us-central1。

API

如要列出「啟用資料快取,提高讀取效能」建議,請按照下列方式呼叫 recommendations.list 方法:

GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations

更改下列內容:

  • PROJECT_ID:您的專案 ID。
  • LOCATION:執行個體所在的區域,例如 us-central1。

如果推薦工具偵測到可啟用資料快取的執行個體,就會在表格中列出這些執行個體,並顯示執行個體名稱、簡短建議、目前的機型、建議的機型、位置和上次重新整理日期。

查看洞察資料和詳細建議

您可以使用 Cloud de Confiance 控制台、gcloud CLI或 Recommender API,查看可升級至 Cloud SQL Enterprise Plus 版本的執行個體洞察和詳細建議。

控制台

執行下列其中一個步驟:

  • 在「Performance Recommendations」(成效建議) 頁面中,依序點選「Performance recommendations」(成效建議) 資訊卡和「Not optimized with Enterprise Plus」(未透過 Enterprise Plus 最佳化)。系統會顯示建議面板,其中包含執行個體的深入分析和詳細建議。

  • 在「執行個體」頁面,按一下「未透過 Enterprise Plus 最佳化調整」。執行個體清單只會顯示適用建議的執行個體。

gcloud

如要查看可升級執行個體的洞察資料和詳細建議,請執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.PerformanceInsight \
--filter=insightSubtype=READ_HEAVY_WORKLOAD

更改下列內容:

  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的區域,例如 us-central1

API

呼叫 insights.list 方法,如下所示:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights

更改下列內容:

  • PROJECT_ID:專案 ID。
  • LOCATION:區域,例如 us-central1。

畫面上會顯示面板,呈現「洞察」重點指標或資訊的相關洞察。

套用建議

如要採行這項建議,請按照下列步驟操作:

  • 如要升級至 Cloud SQL Enterprise Plus 版本,請按一下「問題」欄中的「未透過 Enterprise Plus 版本最佳化調整」。系統會顯示「升級至 Enterprise Plus 版本」視窗,並提供建議。如要繼續升級,請依序點選「編輯」>「升級」>「自訂執行個體」>「啟用資料快取」。如要進一步瞭解如何升級執行個體,請參閱「使用就地升級功能,將執行個體升級至 Cloud SQL Enterprise Plus 版本」。

後續步驟