【发布时间】:2017-07-20 19:05:26
【问题描述】:
我们有一个表导致在运行“nodetool repair”时读取/写入集群超时,并且导出 (COPY FROM) 功能非常慢(~150 行/分钟),在导出期间日志中有很多 GC 错误。
似乎这可能是架构的问题,因为具有相似数据量(约 150 万行)的其他表表现正常。
这个架构有什么明显的问题吗?
CREATE TABLE reportingtest.events (
year int,
month int,
day int,
hour int,
action text,
id uuid,
attributes frozen<list<frozen<attribute>>>,
domain text,
organisation text,
status text,
PRIMARY KEY ((year, month), day, hour, action, id)
) WITH CLUSTERING ORDER BY (day ASC, hour ASC, action ASC, id ASC)
使用的两个 UDT 是:
CREATE TYPE reportingtest.attribute (
namespace text,
name text,
displayname text,
values frozen<list<frozen<attributevalue>>>
);
和
CREATE TYPE reportingtest.attributevalue (
aggregationvalue text,
extra frozen<map<text, text>>
);
那我做错了什么?
集群正在运行[cqlsh 5.0.1 | Cassandra 3.0.9 | CQL spec 3.4.0 | Native protocol v4].
Percentile Partition Size Cell Count
50% 25109160 61214
75% 30130992 61214
95% 89970660 182785
98% 129557750 379022
99% 268650950 654949
Min 373 18
Max 464228842 113175
【问题讨论】:
-
使用
tracing on运行一些查询并检查生成了多少墓碑 -
感谢您的建议。此表上没有删除,也没有任何更新,所以我不确定墓碑是问题所在。尝试几个查询我每次都得到
Read 1000 live and 0 tombstone cells。 -
docs.datastax.com/en/cassandra/3.0/cassandra/tools/… - 您还应该检查您的分区是否“太大”
-
谢谢。嗯。我在想一个 200mb 的分区和最大 500mb 的分区可能“太大”了吗? (我在某处读到 100mb 是最佳的)。看来我需要更改分区键?
-
Percentile Partition Size Cell Count 50% 25109160 61214 75% 30130992 61214 95% 89970660 182785 98% 129557750 379022 99% 268650950 654949 Min 373 18 Max 464228842 113175抱歉 - 不知道如何在评论中格式化。