本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
提高現有 DynamoDB 資料表的暖輸送量
檢查完 DynamoDB 資料表目前的暖輸送量值後,請依下列步驟進行更新:
若要透過 DynamoDB 主控台檢查 DynamoDB 資料表的暖輸送量值:
登入 AWS 管理主控台 ,並在 https://https://console.aws.amazon.com/dynamodb/
開啟 DynamoDB 主控台。 -
在左側導覽窗格中,選擇 Tables (資料表)。
-
在資料表頁面上,選取目標資料表。
-
在暖輸送量欄位中,選取編輯。
-
在編輯暖輸送量頁面上,選擇提高暖輸送量。
-
調整每秒讀取單位與每秒寫入單位。這兩個設定決定資料表可立即處理的輸送量上限。
-
選取 Save (儲存)。
-
當請求處理完成後,暖輸送量欄位會更新每秒讀取單位和每秒寫入單位的最新值。
注意
更新暖輸送量值為非同步作業。當更新完成時,
Status會從UPDATING變更為ACTIVE。
下列 AWS CLI 範例示範如何更新 DynamoDB 資料表的暖輸送量值。
-
在 DynamoDB 資料表上執行
update-table操作。aws dynamodb update-table \ --table-name GameScores \ --warm-throughput ReadUnitsPerSecond=12345,WriteUnitsPerSecond=4567 \ --global-secondary-index-updates \ "[ { \"Update\": { \"IndexName\": \"GameTitleIndex\", \"WarmThroughput\": { \"ReadUnitsPerSecond\": 88, \"WriteUnitsPerSecond\": 77 } } } ]" \ --region us-east-1 -
系統會傳回類似下列的回應。
WarmThroughput設定會顯示為ReadUnitsPerSecond和WriteUnitsPerSecond。當暖輸送量值正在更新時,Status會顯示為UPDATING;當設定完成後,則顯示為ACTIVE。{ "TableDescription": { "AttributeDefinitions": [ { "AttributeName": "GameTitle", "AttributeType": "S" }, { "AttributeName": "TopScore", "AttributeType": "N" }, { "AttributeName": "UserId", "AttributeType": "S" } ], "TableName": "GameScores", "KeySchema": [ { "AttributeName": "UserId", "KeyType": "HASH" }, { "AttributeName": "GameTitle", "KeyType": "RANGE" } ], "TableStatus": "ACTIVE", "CreationDateTime": 1730242189.965, "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "ReadCapacityUnits": 20, "WriteCapacityUnits": 10 }, "TableSizeBytes": 0, "ItemCount": 0, "TableArn": "arn:aws:dynamodb:us-east-1:XXXXXXXXXXXX:table/GameScores", "TableId": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "GlobalSecondaryIndexes": [ { "IndexName": "GameTitleIndex", "KeySchema": [ { "AttributeName": "GameTitle", "KeyType": "HASH" }, { "AttributeName": "TopScore", "KeyType": "RANGE" } ], "Projection": { "ProjectionType": "INCLUDE", "NonKeyAttributes": [ "UserId" ] }, "IndexStatus": "ACTIVE", "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "ReadCapacityUnits": 50, "WriteCapacityUnits": 25 }, "IndexSizeBytes": 0, "ItemCount": 0, "IndexArn": "arn:aws:dynamodb:us-east-1:XXXXXXXXXXXX:table/GameScores/index/GameTitleIndex", "WarmThroughput": { "ReadUnitsPerSecond": 50, "WriteUnitsPerSecond": 25, "Status": "UPDATING" } } ], "DeletionProtectionEnabled": false, "WarmThroughput": { "ReadUnitsPerSecond": 12300, "WriteUnitsPerSecond": 4500, "Status": "UPDATING" } } }
下列 SDK 範例示範如何更新 DynamoDB 資料表的暖輸送量設定。