cassandra SSTABLE_SIZE_IN_MB设置2048为什么SSTable仍然滚动到12G

rdlzhqv9  于 12个月前  发布在  Cassandra
关注(0)|答案(1)|浏览(231)

表:

CREATE TABLE ts_kv_cf (
    entity_type text,
    entity_id timeuuid,
    key text,
    partition bigint,
    ts bigint,
    bool_v boolean,
    dbl_v double,
    json_v text,
    long_v bigint,
    str_v text,
    PRIMARY KEY ((entity_type, entity_id, key, partition), ts)
) WITH CLUSTERING ORDER BY (ts ASC)
    AND additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = false
    AND comment = ''
    AND compaction = {'class': 'LeveledCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4','sstable_size_in_mb': 2048}
    AND compression = {'chunk_length_in_kb': '16', 'class': 'LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND extensions = {}
    AND gc_grace_seconds = 60
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128 
    AND read_repair = 'BLOCKING'
    AND speculative_retry = '99p';

字符串
enter image description here
28 sstable合成仅变为L1 log:

WARN  [CompactionExecutor:3] 2023-12-19 04:33:00,956 BigTableWriter.java:258 - Writing large partition msaiotsensingplatform/ts_kv_cf:DEVICE:6d73cf00-8e53-11ee-af17-332295359987:image:1701388800000 (4.441GiB) to sstable /data/cassandra/data/msaiotsensingplatform/ts_kv_cf-34a4a8208e5311eebe3f5b77f76fb8f3/nb-29-big-Data.db
INFO  [CompactionExecutor:3] 2023-12-19 04:33:06,614 CompactionTask.java:249 - Compacted (task id: 880b7730-9e27-11ee-8a63-1b9ea6be4de4, compaction history id: b49c7650-9e27-11ee-8a63-1b9ea6be4de4) 3 sstables to [/data/cassandra/data/msaiotsensingplatform/ts_kv_cf-34a4a8208e5311eebe3f5b77f76fb8f3/nb-29-big,] to level=1.  4.457GiB to 4.457GiB (~100% of original) in 74,768ms.  Read Throughput = 61.042MiB/s, Write Throughput = 61.042MiB/s, Row Throughput = ~107/s.  3 total partitions merged to 1.  Partition merge counts were {3:1, }


我该怎么办?为了限制SSTable的大小?

mjqavswn

mjqavswn1#

在LCS中,级别0的作用类似于STCS,可以允许一个分区跨越级别中的多个文件,而级别1以上则遵守规则,即分区在每个级别上最多只能出现在1个文件中。如果您的分区足够大,例如大于您设置的2 GB,则文件可以大于2 GB。
您有一个4.4 GB的分区,因此写入该文件以包含整个分区。
建议对表重新建模,使其具有较小的分区。

相关问题