【发布时间】:2013-06-24 13:41:48
【问题描述】:
我正在用一个简单的模型测试 cassandra 的性能。
CREATE TABLE "NoCache" (
key ascii,
column1 ascii,
value ascii,
PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE AND
bloom_filter_fp_chance=0.010000 AND
caching='ALL' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
我正在使用 pycassa、get/xget 函数 () 获取行键的 100 列。但在服务器中获得大约 15 毫秒的读取延迟。
colums=COL_FAM.get(row_key, column_count=100)
nodetool cfstats
Column Family: NoCache
SSTable count: 1
Space used (live): 103756053
Space used (total): 103756053
Number of Keys (estimate): 128
Memtable Columns Count: 0
Memtable Data Size: 0
Memtable Switch Count: 0
Read Count: 20
Read Latency: 15.717 ms.
Write Count: 0
Write Latency: NaN ms.
Pending Tasks: 0
Bloom Filter False Positives: 0
Bloom Filter False Ratio: 0.00000
Bloom Filter Space Used: 976
Compacted row minimum size: 4769
Compacted row maximum size: 557074610
Compacted row mean size: 87979499
这种类型的延迟是惊人的!当 nodetool info 显示读取直接在行缓存中命中。
Row Cache : size 4834713 (bytes), capacity 67108864 (bytes), 35 hits, 38 requests, 1.000 recent hit rate, 0 save period in seconds
谁能告诉我为什么 cassandra 在读取行缓存时要花这么多时间?
【问题讨论】:
-
它是否真的命中了行缓存? “nodetool info”是否显示点击次数增加?您在 cassandra.yaml 中将 row_cache_size_in_mb 设置为什么?默认值为 0,即禁用行缓存。
-
row_cache_size_in_mb = 64 MAX_HEAP_SIZE = "2G"
-
nodetool 信息,给定的输出和评论中添加的其他配置:)
标签: performance cassandra