Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
在 Amazon Keyspaces 中查看表的容量模式
您可以在 Amazon Keyspaces 系统键空间中查询系统表,以查看有关表的容量模式信息。您还可以查看表使用的是按需吞吐容量模式还是预置吞吐容量模式。如果表配置为预置吞吐量模式,您会看到为表预置的吞吐容量。
您也可以使用 Amazon CLI 查看表的容量模式。
要更改表的预置吞吐量,请使用 更改容量模式。
- Cassandra Query Language (CQL)
-
示例
SELECT * from system_schema_mcs.tables where keyspace_name = 'mykeyspace' and table_name = 'mytable';
使用按需容量模式配置的表返回以下内容。
{
"capacity_mode":{
"last_update_to_pay_per_request_timestamp":"1579551547603",
"throughput_mode":"PAY_PER_REQUEST"
}
}
使用预置吞吐容量模式配置的表将返回以下内容。
{
"capacity_mode":{
"last_update_to_pay_per_request_timestamp":"1579048006000",
"read_capacity_units":"5000",
"throughput_mode":"PROVISIONED",
"write_capacity_units":"6000"
}
}
last_update_to_pay_per_request_timestamp
值以毫秒为单位。
- CLI
-
使用查看表的吞吐容量模式 Amazon CLI
aws keyspaces get-table --keyspace-name myKeyspace --table-name myTable
对于预置容量模式下的表,此命令的输出可能类似于以下内容。
"capacitySpecification": {
"throughputMode": "PROVISIONED",
"readCapacityUnits": 4000,
"writeCapacityUnits": 2000
}
而在按需模式下,表的输出类似如下内容。
"capacitySpecification": {
"throughputMode": "PAY_PER_REQUEST",
"lastUpdateToPayPerRequestTimestamp": "2024-10-03T10:48:19.092000+00:00"
}