DynamoDB テーブルを作成するときに、以下の手順に従ってウォームスループット値を調整できます。これらのステップは、グローバルテーブルまたはセカンダリインデックスを作成する場合にも適用されます。
コンソールを使用して DynamoDB テーブルを作成し、ウォームスループット値を調整するには:
AWS Management Console にサインインして DynamoDB コンソール (https://console.aws.amazon.com/dynamodb/
) を開きます。 -
[テーブルの作成] を選択します。
-
[テーブル名]、[パーティションキー]、[ソートキー] (オプション) を選択します。
-
[テーブル設定] セクションで [設定をカスタマイズ] を選択します。
-
[ウォームスループット] フィールドで、[ウォームスループットを増やす] を選択します。
-
[1 秒あたりの読み取りユニット] と [1 秒あたりの書き込みユニット] を調整します。これら 2 つの設定は、テーブルが即座に処理できる最大スループットを定義します。
-
残りのテーブルの詳細を追加し、[テーブルの作成] を選択します。
次の AWS CLI の例は、カスタマイズされたウォームスループット値を使用して DynamoDB テーブルを作成する方法を示しています。
-
create-table
オペレーションを実行して、次の DynamoDB テーブルを作成します。aws dynamodb create-table \ --table-name GameScores \ --attribute-definitions AttributeName=UserId,AttributeType=S \ AttributeName=GameTitle,AttributeType=S \ AttributeName=TopScore,AttributeType=N \ --key-schema AttributeName=UserId,KeyType=HASH \ AttributeName=GameTitle,KeyType=RANGE \ --provisioned-throughput ReadCapacityUnits=20,WriteCapacityUnits=10 \ --global-secondary-indexes \ "[ { \"IndexName\": \"GameTitleIndex\", \"KeySchema\": [{\"AttributeName\":\"GameTitle\",\"KeyType\":\"HASH\"}, {\"AttributeName\":\"TopScore\",\"KeyType\":\"RANGE\"}], \"Projection\":{ \"ProjectionType\":\"INCLUDE\", \"NonKeyAttributes\":[\"UserId\"] }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": 50, \"WriteCapacityUnits\": 25 },\"WarmThroughput\": { \"ReadUnitsPerSecond\": 1987, \"WriteUnitsPerSecond\": 543 } } ]" \ --warm-throughput ReadUnitsPerSecond=12345,WriteUnitsPerSecond=4567 \ --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": "CREATING", "CreationDateTime": 1730241788.779, "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": "CREATING", "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": 1987, "WriteUnitsPerSecond": 543, "Status": "UPDATING" } } ], "DeletionProtectionEnabled": false, "WarmThroughput": { "ReadUnitsPerSecond": 12345, "WriteUnitsPerSecond": 4567, "Status": "UPDATING" } } }
次の SDK の例は、カスタマイズされたウォームスループット値を使用して DynamoDB テーブルを作成する方法を示しています。