

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

# Memcached 快取和叢集的指標和事件
<a name="serverless-metrics-events.memcached"></a>

本節說明使用 Memcached 節點型快取和無伺服器快取時，您可以監控的指標和事件。

**Topics**
+ [ElastiCache Serverless for Memcached 的指標](#serverless-metrics-memcached)
+ [ElastiCache Serverless for Memcached 的事件](#serverless-events.memcached)

## ElastiCache Serverless for Memcached 的指標
<a name="serverless-metrics-memcached"></a>

本節說明使用 ElastiCache Serverless for Memcached 時可監控的指標和事件。

`AWS/ElastiCache` 命名空間包含適用於 Redis 無伺服器快取的下列 CloudWatch 指標。


| 指標 | Description | 單位 | 
| --- | --- | --- | 
|  BytesUsedForCache  |  儲存在快取中的資料所使用的位元組總數。  |  位元組  | 
|  ElastiCacheProcessingUnits  |  在快取上執行的請求所消耗的 ElastiCacheProcessingUnits (ECPU) 總數  |  計數  | 
|  SuccessfulReadRequestLatency  |  成功讀取請求的延遲。  |  微秒  | 
|  SuccessfulWriteRequestLatency  |  成功寫入請求的延遲  |  微秒  | 
|  TotalCmdsCount  |  快取上執行的所有命令總數  |  計數  | 
|  CurrConnections  |  快取的用戶端連線數。  |  計數  | 
|  ThrottledCmds  |  因為工作負載的擴展速度比 ElastiCache 能夠擴展的速度快，而遭到 ElastiCache 限流的請求數。  |  計數  | 
|  NewConnections  |  在此期間內，伺服器已接受的連線總數。  |  計數  | 
|  CurrItems  |  快取中的項目數。  |  計數  | 
|  NetworkBytesIn  |  傳入快取的位元組總數  |  位元組  | 
|  NetworkBytesOut  |  從快取傳出的位元組總數  |  位元組  | 
|  移出  |  由快取移出的索引鍵計數  |  計數  | 
|  已回收  |  快取使其到期的金鑰數目  |  計數  | 

**命令層級指標**

ElastiCache 也會發出下列 Memcached 命令層級指標


| 指標 | Description | 單位 | 
| --- | --- | --- | 
|  CmdGet  |  快取已接收到的 get 命令的數量。  |  計數  | 
|  CmdSet  |  快取接收到的 set 命令數量。  |  計數  | 
|  CmdTouch  |  快取已接收到的 touch 命令數量。  |  計數  | 
|  GetHits  |  在請求的金鑰已找到的情況下，快取接收到的取得請求的數量。  |  計數  | 
|  GetMisses  |  快取已接收到其請求的金鑰未找到的取得請求的數量。  |  計數  | 
|  IncrHits  |  在請求的金鑰已找到的情況下，快取接收到的增加請求的數量。  |  計數  | 
|  IncrMisses  |  在請求的金鑰未找到的情況下，快取接收到的增加請求的數量。  |  計數  | 
|  DecrHits  |  在請求的金鑰已找到的情況下，快取接收到的減少請求的數量。  |  計數  | 
|  DecrMisses  |  在請求的金鑰未找到的情況下，快取接收到的減少請求的數量。  |  計數  | 
|  DeleteHits  |  在請求的金鑰已找到的情況下，快取接收到的刪除請求的數量。  |  計數  | 
|  DeleteMisses  |  在請求的金鑰未找到的情況下，快取接收到的刪除請求的數量。  |  計數  | 
|  TouchHits  |  已被碰觸並賦予新的過期時間的金鑰的數量。  |  計數  | 
|  TouchMisses  |  已執行 touch 但未找到的金鑰數量。  |  計數  | 
|  CasHits  |  在請求的金鑰已找到且 cas 值相符的情況下，快取已接收到的 cas 請求數量。  |  計數  | 
|  CasMisses  |  在請求的金鑰未找到的情況下，快取已接收到 cas 請求數量。  |  計數  | 
|  CasBadval  |  在 cas 值與儲存的 cas 值不相符的情況下，快取已接收到的 cas 請求數量。  |  計數  | 
|  CmdFlush  |  快取已接收到的 flush 命令的數量。  |  計數  | 

## ElastiCache Serverless for Memcached 的事件
<a name="serverless-events.memcached"></a>

與您的無伺服器快取相關的 ElastiCache 日誌事件。此資訊包括事件的日期和時間、事件的來源名稱和來源類型，以及事件的描述。您可以使用 ElastiCache 主控台、AWS CLI describe-events 命令或 ElastiCache API 動作 從日誌輕鬆擷取事件`DescribeEvents`。

您可以選擇使用 Amazon EventBridge 來監控、擷取、轉換和處理 ElastiCache 事件。如需進一步了解，請參閱 Amazon EventBridge [入門指南](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-get-started.html)。

**檢視 ElastiCache 事件 (主控台)**

使用 ElastiCache 主控台檢視事件：

1. 登入AWS 管理主控台，並在 https：//[https://console.aws.amazon.com/elasticache/](https://console.aws.amazon.com/elasticache/) 開啟 ElastiCache 主控台

1. 若要查看所有可用事件的清單，請在導覽窗格中選擇 **Events (事件)**。

1. 在*事件*畫面上，清單中的每一列都代表一個事件，並顯示事件來源、事件類型、事件的 GMT 時間以及事件的說明。您可以使用 **Filter (篩選條件)** 指定要查看事件清單中的所有事件，還是只查看特定類型的事件。

**檢視 ElastiCache 事件 (AWS CLI)**

若要使用 產生 ElastiCache 事件清單AWS CLI，請使用 命令 describe-events。您可以使用選用參數來控制列出的事件類型、列出的事件時間範圍，要列出的最大事件數等等。

下列程式碼最多會列出 40 個無伺服器快取事件。

```
aws elasticache describe-events --source-type serverless-cache --max-items 40
```

下列程式碼會列出過去 24 小時 (1440 分鐘) 內無伺服器快取的所有事件。

```
aws elasticache describe-events --source-type serverless-cache --duration 1440
```

**無伺服器事件**

本節記錄您可能收到的不同類型無伺服器快取事件。

**無伺服器快取建立事件**


| Detail-Type | Description | 單位 | 來源 | 訊息 | 
| --- | --- | --- | --- | --- | 
|  快取已建立  |  Cache arn  |  建立  |  serverless-cache  |  快取 <cache-name> 已建立且可供使用。  | 
|  快取建立失敗  |  Cache arn  |  失敗  |  serverless-cache  |  無法建立快取 <cache-name>。沒有足夠的可用 IP 地址可用來建立 VPC 端點。  | 
|  快取建立失敗  |  Cache arn  |  失敗  |  serverless-cache  |  無法建立快取 <cache-name>。請求中提供的子網路無效。  | 
|  快取建立失敗  |  Cache arn  |  失敗  |  serverless-cache  |  無法建立快取 <cache-name>。已達建立 VPC 端點的配額限制。  | 
|  快取建立失敗  |  Cache arn  |  失敗  |  serverless-cache  |  無法建立快取 <cache-name>。您沒有建立 VPC 端點的許可。  | 

**無伺服器快取更新事件 (Memcached)**


| Detail-Type | 資源清單 | Category | 來源 | 訊息 | 
| --- | --- | --- | --- | --- | 
|  快取已更新  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 的 SecurityGroups 已更新。  | 
|  快取已更新  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 的標籤已更新。  | 
|  快取更新失敗  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 更新失敗。SecurityGroups 更新失敗。  | 
|  快取更新失敗  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 更新失敗。SecurityGroups 更新失敗，因為許可不足。  | 
|  快取更新失敗  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 更新失敗。SecurityGroups 更新失敗，因為 SecurityGroups 無效。  | 

**無伺服器快取刪除事件 (Memcached)**


| Detail-Type | 資源清單 | Category | 來源 | 訊息 | 
| --- | --- | --- | --- | --- | 
|  快取已刪除  |  Cache arn  |  刪除  |  serverless-cache  |  快取 <cache-name> 已刪除。  | 

**無伺服器快取用量限制事件 (Memcached)**


| Detail-Type | Description | 單位 | 來源 | 訊息 | 
| --- | --- | --- | --- | --- | 
|  快取已更新  |  Cache arn  |  組態變更  |  serverless-cache  |  快取 <cache-name> 的限制已更新。  | 
|  快取更新失敗  |  Cache arn  |  失敗  |  serverless-cache  |  快取 <cache-name> 的限制更新失敗，因為快取已刪除。  | 
|  快取更新失敗  |  Cache arn  |  失敗  |  serverless-cache  |  快取 <cache-name> 的限制更新失敗，因為組態無效。  | 

**無伺服器快取快照事件 (Memcached)**


| Detail-Type | 資源清單 | Category | 來源 | 訊息 | 
| --- | --- | --- | --- | --- | 
|  快照已建立  |  Cache arn Snapshot arn  |  建立  |  serverless-cache-snapshot  |  已建立快取 <cache-name> 的快照 <snapshot-name>。  | 
|  快照建立失敗  |  Cache arn Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法建立快取 <cache-name> 的快照。快照 <snapshot-name> 建立失敗，客戶受管金鑰 <key-id>，<reason>。 失敗原因訊息： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonElastiCache/latest/dg/serverless-metrics-events.memcached.html)  | 
|  快照建立失敗  |  Cache arn Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法建立快取 <cache-name> 的快照。快照 <snapshot-name> 建立失敗，原因：<reason>。 預設原因： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonElastiCache/latest/dg/serverless-metrics-events.memcached.html)  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 %s，因為 ElastiCache 未具備該儲存貯體的許可。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'，因為儲存貯體中已有同名的物件。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'，因為儲存貯體擁有者帳戶 ID 已變更。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'，因為無法存取 S3 儲存貯體。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'，因為無法存取儲存貯體。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'，因為儲存貯體不存在。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至具有來源快照客戶受管金鑰 %s 的儲存貯體 '%s'，<reason>。  | 
|  快照匯出失敗  |  Snapshot arn  |  失敗  |  serverless-cache-snapshot  |  無法匯出快取 <cache-name> 的快照。無法將快照匯出至儲存貯體 '%s'。  | 
|  快照複製失敗  |  Snapshot arn-1 Snapshot arn-2  |  失敗  |  serverless-cache-snapshot  |  無法複製快照 <snapshot-name>。無法將快照 '%s' 複製到快照 '%s'，因為來源快照客戶受管金鑰為 <key-id>，<reason-name>。  | 
|  快照複製失敗  |  Snapshot arn-1 Snapshot arn-2  |  失敗  |  serverless-cache-snapshot  |  無法複製快照 <snapshot-name>。無法將快照 '%s' 複製到快照 '%s'，因為目標快照客戶受管金鑰為 '%s' '%s'。  | 