支援的監控指標

本頁面列出適用於 Memorystore for Redis 叢集的 Cloud Monitoring 指標,並說明各項指標的用途。

Cloud Monitoring 指標

叢集層級指標

這些指標可提供叢集整體健康狀態和效能的概要資訊。這些指標有助於瞭解叢集的整體容量和使用率,以及找出潛在瓶頸或可改善的區域。

指標名稱 說明
redis.googleapis.com/cluster/clients/average_connected_clients 叢集目前的平均用戶端連線數。
redis.googleapis.com/cluster/clients/maximum_connected_clients 叢集目前用戶端連線數上限。
redis.googleapis.com/cluster/clients/total_connected_clients 目前叢集的用戶端連線數。
redis.googleapis.com/cluster/stats/total_connections_received_count 過去一分鐘內建立的叢集層級用戶端連線總數。
redis.googleapis.com/cluster/stats/cluster/stats/total_rejected_connections_count 因 maxclients 限制而遭拒的連線數量。
redis.googleapis.com/cluster/commandstats/total_usec_count 每個指令耗用的總時間。
redis.googleapis.com/cluster/commandstats/total_calls_count 一分鐘內此指令的呼叫總數。
redis.googleapis.com/cluster/cpu/average_utilization 叢集的平均 CPU 使用率,範圍為 0.0 到 1.0。
redis.googleapis.com/cluster/cpu/maximum_utilization

叢集的最高 CPU 使用率,範圍為 0.0 到 1.0。

請確認主要節點的 CPU 使用率不超過 0.8 秒,且每個指定為讀取副本的副本不超過 0.5 秒。詳情請參閱「CPU 使用率最佳做法」。

redis.googleapis.com/cluster/stats/average_expired_keys 主要項目的平均金鑰到期事件數。
redis.googleapis.com/cluster/stats/maximum_expired_keys 主要金鑰到期事件的數量上限。
redis.googleapis.com/cluster/stats/total_expired_keys_count 主要的索引鍵到期事件總數。
redis.googleapis.com/cluster/stats/average_evicted_keys 主要節點因記憶體容量而遭逐出的鍵平均數量。
redis.googleapis.com/cluster/stats/maximum_evicted_keys 主要記憶體容量導致遭逐出的鍵數量上限
redis.googleapis.com/cluster/stats/total_evicted_keys_count 主要節點記憶體容量不足而遭逐出的鍵數量。
redis.googleapis.com/cluster/keyspace/total_keys 叢集中儲存的索引鍵數量。
redis.googleapis.com/cluster/stats/average_keyspace_hits 叢集中成功查閱鍵的平均次數。
redis.googleapis.com/cluster/stats/maximum_keyspace_hits 叢集中成功查閱金鑰的次數上限。
redis.googleapis.com/cluster/stats/total_keyspace_hits_count 整個叢集成功查閱金鑰的次數。
redis.googleapis.com/cluster/stats/average_keyspace_misses 叢集中鍵查閱失敗的平均次數。
redis.googleapis.com/cluster/stats/maximum_keyspace_misses 叢集中金鑰查閱失敗次數上限。
redis.googleapis.com/cluster/stats/total_keyspace_misses_count 叢集中失敗的鍵查閱總數。
redis.googleapis.com/cluster/memory/average_utilization 叢集的平均記憶體使用率,範圍從 0.0 到 1.0。
redis.googleapis.com/cluster/memory/maximum_utilization 叢集的最高記憶體使用率,範圍從 0.0 到 1.0。
redis.googleapis.com/cluster/memory/total_used_memory 叢集的記憶體總用量。
redis.googleapis.com/cluster/memory/size 叢集的記憶體大小。
redis.googleapis.com/cluster/replication/average_ack_lag 叢集內副本的平均確認延遲時間 (以秒為單位)。

確認延遲時間是叢集主要節點的瓶頸。這是因為備用節點無法跟上主要節點傳送的資訊,導致出現瓶頸。發生這種情況時,主要節點必須等待副本收到資訊的確認訊息。這可能會導致交易提交速度變慢,並對主要節點的效能造成影響。
redis.googleapis.com/cluster/replication/maximum_ack_lag 叢集中副本的確認延遲時間上限 (以秒為單位)。
redis.googleapis.com/cluster/replication/average_offset_diff 叢集中的平均複寫確認位移差異 (以位元組為單位)。

複寫確認位移差異是指副本及其主要副本之間未複寫的位元組數。
redis.googleapis.com/cluster/replication/maximum_offset_diff 叢集中的最大複製偏移差異 (以位元組為單位)。

複製偏移差異是指備用資源與主要資源之間未複製的位元組數。
redis.googleapis.com/cluster/stats/total_net_input_bytes_count 叢集端點接收的連入網路位元組數。
redis.googleapis.com/cluster/stats/total_net_output_bytes_count 從叢集端點傳送的連出網路位元組數。

節點層級指標

這些指標可提供叢集中個別節點的健康狀態和效能詳細深入分析。有助於排解特定節點的問題,並提升效能。

指標名稱 說明
redis.googleapis.com/cluster/node/clients/connected_clients 連線至叢集節點的用戶端數量。
redis.googleapis.com/cluster/node/clients/blocked_clients 叢集節點封鎖的用戶端連線數。
redis.googleapis.com/cluster/node/server/uptime 測量叢集節點的正常運作時間。
redis.googleapis.com/cluster/node/stats/connections_received_count 叢集節點在過去一分鐘內建立的用戶端連線總數。
redis.googleapis.com/cluster/node/stats/rejected_connections_count 叢集節點的 maxclients 限制導致連線遭拒的次數。
redis.googleapis.com/cluster/node/commandstats/usec_count 叢集節點中每個指令耗用的總時間。
redis.googleapis.com/cluster/node/commandstats/calls_count 叢集節點上這個指令在一分鐘內的呼叫總數。
redis.googleapis.com/cluster/node/cpu/utilization 叢集節點的 CPU 使用率,範圍從 0.0 到 1.0。
redis.googleapis.com/cluster/node/stats/expired_keys_count 叢集節點中的到期事件總數。
redis.googleapis.com/cluster/node/stats/evicted_keys_count 叢集節點逐出的鍵總數。
redis.googleapis.com/cluster/node/keyspace/total_keys 儲存在叢集節點中的金鑰數量。
redis.googleapis.com/cluster/node/stats/keyspace_hits_count 叢集節點中成功查閱索引鍵的次數。
redis.googleapis.com/cluster/node/stats/keyspace_misses_count 叢集節點中無法查閱的鍵數量。
redis.googleapis.com/cluster/node/memory/utilization 叢集節點內的記憶體使用率,範圍為 0.0 到 1.0。
redis.googleapis.com/cluster/node/memory/usage 叢集節點的記憶體總用量。
redis.googleapis.com/cluster/node/stats/net_input_bytes_count 叢集節點接收的連入網路位元組數。
redis.googleapis.com/cluster/node/stats/net_output_bytes_count 從叢集節點傳送的連出網路位元組數。
redis.googleapis.com/cluster/node/replication/offset 測量叢集節點的複製偏移位元組。
redis.googleapis.com/cluster/node/server/healthy 判斷叢集節點是否可用且運作正常。 這項指標目前為預先發布版

跨區域複製指標

本節列出用於跨區域複製的指標。

指標名稱 說明
redis.googleapis.com/cluster/cross_cluster_replication/secondary_replication_links 這項指標會顯示主要和次要叢集之間的分片連結數量。在跨區域複製 (CRR) 群組中,主要叢集會回報其與群組中次要叢集的 CRR 複製連結數量。對於每個次要叢集,這個數字應等於分片數。如果數量意外低於分片數量,這表示複製器和追蹤者之間的複製作業已停止,並指出分片數量。在理想狀態下,這個指標應與主要叢集分片計數相同。
redis.googleapis.com/cluster/cross_cluster_replication/secondary_maximum_replication_offset_diff 主要分片和次要分片之間的最大複製偏移差異。
redis.googleapis.com/cluster/cross_cluster_replication/secondary_average_replication_offset_diff 主要分片和次要分片之間的平均複製偏移差異。

備份指標

本節列出備份匯入指標。

叢集層級指標

指標名稱 說明
redis.googleapis.com/cluster/backup/last_backup_start_time 上次備份作業的開始時間。
redis.googleapis.com/cluster/backup/last_backup_status 上次備份作業的狀態。狀態為 1 (成功) 和 0 (失敗)。
redis.googleapis.com/cluster/backup/last_backup_duration 上次備份作業的時間長度 (以毫秒為單位)。
redis.googleapis.com/cluster/backup/last_backup_size 上次備份的大小 (以位元組為單位)。
redis.googleapis.com/cluster/import/last_import_start_time 上次匯入作業的開始時間。
redis.googleapis.com/cluster/import/last_import_duration 上次匯入作業的時間長度(以毫秒為單位)。

持續性指標

本節列出持續性指標,並提供持續性指標的用途範例。

RDB 持久性指標

叢集層級指標

指標名稱 說明
redis.googleapis.com/cluster/persistence/rdb_saves_count 這項指標會顯示叢集擷取 RDB 快照的累計次數 (也稱為「儲存」)。這項指標有 status_code 欄位。如要檢查快照是否失敗,可以依下列錯誤篩選 status_code 欄位:3 - INTERNAL_ERROR
redis.googleapis.com/cluster/persistence/rdb_save_ages 這項指標會顯示叢集所有節點的發布快照年齡。理想情況下,您會希望看到延遲時間小於 (或等於) 快照頻率的值。

節點層級指標

指標名稱 說明
redis.googleapis.com/cluster/node/persistence/rdb_bgsave_in_progress 這項指標會顯示叢集節點目前是否正在進行 RDB BGSAVE。TRUE 表示正在進行中。
redis.googleapis.com/cluster/node/persistence/rdb_last_bgsave_status 這項指標會顯示叢集節點上次 BGSAVE 的成功與否。TRUE 代表成功,如果沒有發生 bgrewrite,值可能會預設為 TRUE。
redis.googleapis.com/cluster/node/persistence/rdb_saves_count 這項指標會顯示叢集節點上執行的 RDB 儲存作業累計次數。
redis.googleapis.com/cluster/node/persistence/rdb_last_save_age 這項指標會顯示自上次成功建立快照以來經過的時間 (以秒為單位)。
redis.googleapis.com/cluster/node/persistence/rdb_next_save_time_until 這個指標會顯示距離下一個快照的剩餘時間 (以秒為單位)。
redis.googleapis.com/cluster/node/persistence/current_save_keys_total 這項指標會顯示叢集節點上目前執行的 RDB 儲存作業中的鍵數。

AOF 持久性指標

叢集層級指標

指標名稱 說明
redis.googleapis.com/cluster/persistence/aof_fsync_lags 這項指標會顯示叢集中所有節點的延遲時間分布情形 (從資料寫入到耐久儲存空間同步)。只有在叢集具有 appendfsync=everysec 時,才會發出這個指標。理想情況下,您會希望看到延遲時間少於 (或等於) AOF 同步頻率的值。
redis.googleapis.com/cluster/persistence/aof_rewrite_count 這項指標會顯示叢集中節點觸發 AOF 重寫的累計次數。這項指標有 status_code 欄位。如要檢查 AOF 重寫是否失敗,可以篩選 status_code 欄位,找出下列錯誤:3 - INTERNAL_ERROR

節點層級指標

指標名稱 說明
redis.googleapis.com/cluster/node/persistence/aof_last_write_status 這項指標會顯示叢集節點最近一次 AOF 寫入作業的成功率。TRUE 表示成功,如果未發生寫入作業,值可能會預設為 TRUE。
redis.googleapis.com/cluster/node/persistence/aof_last_bgrewrite_status 這項指標會顯示叢集節點上最後一次 AOF bgrewrite 作業是否成功。TRUE 代表成功,如果沒有發生 bgrewrite,值可能會預設為 TRUE。
redis.googleapis.com/cluster/node/persistence/aof_fsync_lag 這項指標會顯示叢集節點中,記憶體與永久儲存空間之間的 AOF 延遲時間。僅適用於已啟用 AOF 的叢集,且 appendfsync=EVERYSEC
redis.googleapis.com/cluster/node/persistence/aof_rewrites_count 這項指標會顯示叢集節點中的 AOF 重寫次數。如要檢查 AOF 重寫是否失敗,可以篩選 status_code 欄位,找出下列錯誤:3 - INTERNAL_ERROR
redis.googleapis.com/cluster/node/persistence/aof_fsync_errors_count 這項指標會顯示 AOF fsync() 呼叫錯誤的計數,僅適用於已啟用 AOF 的叢集,且 appendfsync=EVERYSEC|ALWAYS。

常見的持續性指標

適用於 AOF 和 RDB 持續性機制的指標。

節點層級指標

指標名稱 說明
redis.googleapis.com/cluster/node/persistence/auto_restore_count 這項指標會顯示從傾印檔案 (AOF 或 RDB) 還原的次數。

持續性指標的應用實例

檢查 AOF 寫入作業是否會導致延遲和記憶體壓力

假設您發現叢集或叢集內的節點延遲時間增加或記憶體用量提高,在這種情況下,您可能需要檢查額外用量是否與 AOF 持久性有關。

由於您知道 AOF 重寫作業會觸發暫時性負載尖峰,因此可以檢查 aof_rewrites_count 指標,瞭解叢集或叢集內節點生命週期內的 AOF 重寫累計次數。假設這項指標顯示,重寫次數增加會導致延遲時間變長,在這種情況下,您可以降低寫入速率或增加分片數,以減少重寫頻率,解決這個問題。

檢查 RDB 儲存作業是否導致延遲和記憶體壓力

假設您發現叢集或叢集內的節點延遲時間增加或記憶體用量提高,在這種情況下,您可能需要檢查額外用量是否與 RDB 持久性有關。

由於您知道 RDB 儲存作業可能會觸發暫時性負載尖峰,因此可以檢查 rdb_saves_count 指標,該指標會提供叢集或叢集內節點生命週期內的 RDB 儲存累計次數。假設這項指標顯示 RDB 儲存次數增加時,延遲也會增加,在這種情況下,您可以縮短 RDB 快照間隔,降低重寫頻率。您也可以擴充叢集,降低基準負載量。

解讀 Memorystore for Redis Cluster 的指標

如上表所示,許多指標共用三個類別:平均值、最大值和總計。

對於 Memorystore for Redis Cluster,我們提供相同指標的平均最大變異,因此您可以同時使用這兩者,找出該指標系列的熱點。

指標的值是獨立的,可提供與平均最大值熱點分析目的無關的個別洞察資料。

瞭解平均和最高指標

假設您要比較叢集的 average_keyspace_hitsmaximum_keyspace_hits 值。這兩項指標的差異越大,表示您執行個體中的熱點命中次數越多。理想情況下,您會將值設為介於 average_keyspace_hitsmaximum_keyspace_hits 之間,因為這表示命中次數在執行個體中分布得更平均。

這項原則適用於所有具有相同指標平均最大變化的指標。

互動區範例

如果比較叢集中所有分片的 average_keyspace_hitsmaximum_keyspace_hits,這些值會指出發生熱點的位置。舉例來說,假設 6 分片叢集中的分片有以下點擊次數:

  • 資料分割 1 - 2 命中
  • 分片 2 - 2 次命中
  • Shard 3 - 2 hits
  • 分片 4 - 2 次命中
  • Shard 5 - 2 hits
  • 第 6 到 8 個分片

在本例中,average_keyspace_hits 會傳回值 3,而 maximum_keyspace_hits 會傳回 8,表示分片 6 處於熱門狀態。

我們提供節點層級的指標,可用於找出叢集中的熱點。