首页 > 解决方案 > 在 cassandra 中启用读取后,磁盘 io 已增加

问题描述

启用读取后磁盘 io 已增加。它是一个带有 RF 3 的 10 节点集群。响应时间也很长。我们正在使用以下查询来读取数据。有人可以帮助解决/克服这个问题。

不。节点数:10 存储:SSD 操作系统:Centos 7 版本:3.10 读取:1000/分钟

询问:


SELECT  *  FROM Test.table_A WHERE user_id =  ? AND group_type =  ?   ORDER BY group_type ASC  , action_type ASC  , created_at DESC  LIMIT 500;

SELECT * FROM Test.table_A WHERE user_id = 98765432 AND group_type = abc LIMIT 100;

SELECT * FROM Test.table_A WHERE user_id = 10999222 AND group_type = xyz LIMIT 500;

该表的架构

CREATE TABLE Test.table_A (
    user_id text,
    group_type text,
    action_type text,
    created_at timestamp,
    asset_type text,
    content_type text,
    engage_level text,
    group_id text,
    item_id text,
    item_igs text,
    ui_type text,
    PRIMARY KEY (user_id, group_type, action_type, created_at)
) WITH CLUSTERING ORDER BY (group_type ASC, action_type ASC, created_at DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = 'User page view activity is maintained in this table'
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 'compaction_window_size': '3', 'compaction_window_unit': 'DAYS', 'max_threshold': '32', 'min_threshold': '4', 'unchecked_tombstone_compaction': 'true'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 1296000
    AND gc_grace_seconds = 86400
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

标签: cassandra

解决方案


推荐阅读