有没有办法弄清楚每张桌子上有多少请求(读/写)?
我想弄清楚我们有多大负荷。
已经尝试使用:
nodetool tablestats
这不好,因为我看不到请求的数量。
谢谢
tablestats
将为您提供可能足够的请求总数。还可以查看异常值的avg本地读/写延迟。这些费率在JMX中公开,您可以从表格指标中获取:http://cassandra.apache.org/doc/latest/operating/metrics.html#table-metrics
org.apache.cassandra.metrics:type=Table keyspace=<Keyspace> scope=<Table> name=<MetricName>
Metric Name Tye Description
--------------------------------------------------------------------------
ReadLatency Latency Local read latency for this table.
RangeLatency Latency Local range scan latency for this table.
WriteLatency Latency Local write latency for this table.
CoordinatorReadLatency Timer Coordinator read latency for this table.
CoordinatorWriteLatency Timer Coordinator write latency for this table.
CoordinatorScanLatency Timer Coordinator range scan latency for this table.
每个都有1分钟,5分钟和15分钟的费率属性。
java -jar sjk.jar mx -p {PID} -b org.apache.cassandra.metrics:type=ColumnFamily,keyspace=<Keyspace>,scope=<Table>,name=CoordinatorReadLatency --attribute FiveMinuteRate --get
(注意:以与sudo -u
一样的cassandra实例运行的同一用户运行它,或者它可能没有权限连接到jvm)
如果它当前运行高负载你可以使用toppartitions
或profileload
。在某些版本中,toppartition要求你给它表。
#> nodetool profileload
Frequency of reads by partition:
Table Partition Count +/-
basic.wide row1 75424 0
basic.cas p1 656 0
system.paxos 7031 550 0
system.local local 2 0
Frequency of writes by partition:
Table Partition Count +/-
system.paxos 7031 585 0
basic.cas p1 112 0
basic.wide row4864 20 19
basic.wide row4870 20 19
basic.wide row4868 20 19
basic.wide row4871 20 19
Frequency of cas contentions by partition:
Table Partition Count +/-
basic.cas p1 76 0
Max mutation size by partition:
Table Partition Bytes
basic.wide row0 1056
basic.wide row7 1056
basic.wide row11 1056
basic.wide row59 1056
basic.wide row255 1056
Longest read query times:
Query Microseconds
SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 25681
SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 16131
SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 14715
SELECT * FROM system_schema.columns 2784
SELECT * FROM system_schema.columns 2285
SELECT * FROM system_schema.tables 1553
SELECT * FROM system_schema.tables 1275