Aerospike Evict机制
所属分类 aerospike
浏览量 893
设置了TTL的数据 根据TTL大小分桶
每个bucket的大小由最大的TTL和 evict-hist-buckets来决定
bucket_width = max_ttl / evict-hist-buckets
evict-hist-buckets可以基于namespace设置 可以动态修改
high-water-memory-pct high-water-disk-pct 设置 evict 逐出时机
容量超出阈值 等待nsup线程启动 逐出数据
NSUP (namespace supervisor) 负责 过期 和 逐出操作
逐出以bucket为单位,不能只逐出部分
极端情况下 ,数据全部集中在第一个桶 , 不可能全部逐出
bucket中的数量少于evict-tenths-pct 的数量 ,太会逐出
逐出机制 比 Redis 更精细
不过可能需要手工调整 或者 根本没法逐出
tenths 十分之一
evict-tenths-pct 百分比十分之一 相当于千分之几
ns->evict_tenths_pct = 5; // default eviction amount is 0.5%
base/namespace.c
ns->evict_hist_buckets = 10000; // for 30 day TTL, bucket width is 4 minutes 20 seconds
ns->evict_tenths_pct = 5; // default eviction amount is 0.5%
ns->hwm_disk_pct = 50; // evict when device usage exceeds 50%
ns->hwm_memory_pct = 60; // evict when memory usage exceeds 50% of namespace memory-size
ns->max_ttl = MAX_ALLOWED_TTL; // 10 years
ns->stop_writes_pct = 90; // stop writes when 90% of either memory or disk is used
ns->storage_min_avail_pct = 5; // stop writes when < 5% disk is writable
TTL 分部查看
admin
show distribution
ns1 TTL distribution in seconds
percentage of records having ttl less than or equal to value measured in seconds
asadm -e "show distribution"
~~~~~~~~~~~~~~~~~~~test - TTL Distribution in Seconds~~~~~~~~~~~~~~~~~~
Percentage of records having ttl less than or equal to value
measured in Seconds
Node 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
aerospike1 0 0 0 0 0 0 0 0 0 0
aerospike2 0 0 0 0 0 0 0 0 0 0
Number of rows: 2
aerospike3.8及以上版本的数据淘汰机制
aerospike中的过期驱逐和停止写入机制
上一篇
下一篇
各行业编程语言流行榜
c c++ 头文件 string string.h cstring 区别
c++ string
C++经典语录
编程名言名句
C++11 lambda