ceph缓存池设置
时间:2020-11-21 来源:未知 投稿:admin 点击:次
下面开始配置以cache作为sata-pool的前端高速缓冲池。
1)、新建缓冲池,其中,cache作为sata-pool的前端高速缓冲池。
# ceph osd pool create storage 64
pool 'storage' created
# ceph osd pool create cache 64
pool 'cache' created
2)、设定缓冲池读写策略为写回模式。
ceph osd tier cache-mode cache writeback
3)、把缓存层挂接到后端存储池上
# ceph osd tier add storage cache
pool 'cache' is now (or already was) a tier of 'storage'
4)、将客户端流量指向到缓存存储池
# ceph osd tier set-overlay storage cache
overlay for 'storage' is now (or already was) 'cache'
2、调整Cache tier配置
1)、设置缓存层hit_set_type使用bloom过滤器
# ceph osd pool set cache hit_set_type bloom
set pool 27 hit_set_type to bloom
命令格式如下:
ceph osd pool set {cachepool} {key} {value}
关于Bloom-Filte算法原理可参见:
https://blog.csdn.net/jiaomeng/article/details/1495500
2)、设置hit_set_count、hit_set_period
# ceph osd pool set cache hit_set_count 1
set pool 27 hit_set_count to 1
# ceph osd pool set cache hit_set_period 3600
set pool 27 hit_set_period to 3600
# ceph osd pool set cache target_max_bytes 1000000000000
set pool 27 target_max_bytes to 1000000000000
默认情况下缓冲池基于数据的修改时间来进行确定是否命中缓存,也可以设定热度数hit_set_count和热度周期hit_set_period,以及最大缓冲数据target_max_bytes。 hit_set_count 和 hit_set_period 选项分别定义了 HitSet 覆盖的时间区间、以及保留多少个这样的 HitSet,保留一段时间以来的访问记录,这样 Ceph 就能判断一客户端在一段时间内访问了某对象一次、还是多次(存活期与热度)。
3)、设置min_read_recency_for_promete、min_write_recency_for_promote
# ceph osd pool set cache min_read_recency_for_promote 1
set pool 27 min_read_recency_for_promote to 1
# ceph osd pool set cache min_write_recency_for_promote 1
set pool 27 min_write_recency_for_promote to 1
缓存池容量控制 先讲解个概念缓存池代理层两大主要操作
•刷写(flushing):负责把已经被修改的对象写入到后端慢存储,但是对象依然在缓冲池。
•驱逐(evicting):负责在缓冲池里销毁那些没有被修改的对象。
缓冲池代理层进行刷写和驱逐的操作,主要和缓冲池本身的容量有关。在缓冲池里,如果被修改的数据达到一个阈值(阈值(容量百分比),缓冲池代理就开始把这些数据刷写到后端慢存储。当缓冲池里被修改的数据达到40%时,则触发刷写动作。
# ceph osd pool set cache cache_target_dirty_ratio 0.4
当被修改的数据达到一个确定的阈值(容量百分比),刷写动作将会以高速运作。例如,当缓冲池里被修改数据达到60%时候,则高速刷写。
# ceph osd pool set cache cache_target_dirty_high_ratio 0.6
缓冲池的代理将会触发驱逐操作,目的是释放缓冲区空间。例如,当缓冲池里的容量使用达到80%时候,则触发驱逐操作。
# ceph osd pool set cache cache_target_full_ratio 0.8
除了上面提及基于缓冲池的百分比来判断是否触发刷写和驱逐,还可以指定确定的数据对象数量或者确定的数据容量。对缓冲池设定最大的数据容量,来强制触发刷写和驱逐操作。
# ceph osd pool set cache target_max_bytes 1073741824
同时,也可以对缓冲池设定最大的对象数量。在默认情况下,RBD的默认对象大小为4MB,1GB容量包含256个4MB的对象,则可以设定:
# ceph osd pool set cache target_max_objects 256
4)、缓冲池的数据刷新问题在缓冲池里,对象有最短的刷写周期。若被修改的对象在缓冲池里超过最短周期,将会被刷写到慢存储池。
# ceph osd pool set cache cache_min_flush_ age 600
注意:单位是分钟
设定对象最短的驱逐周期。
# ceph osd pool set cache cache_min_evict_age 1800
3、删除缓存层 删除readonly缓存 1)、把缓存模式改为 none 即可禁用。
ceph osd tier cache-mode {cachepool} none
2)、去除后端存储池的缓存池。
ceph osd tier remove {storagepool} {cachepool}
删除writeback缓存 1)、把缓存模式改为 forward ,这样新的和更改过的对象将直接刷回到后端存储池
# ceph osd tier cache-mode cache forward --yes-i-really-mean-it
set cache-mode for pool 'cache' to forward
2)、确保缓存池已刷回,可能要等数分钟
# rados ls -p cache
可以通过以下命令进行手动刷回
# rados -p cache cache-flush-evict-all
3)、取消流量指向缓存池
# ceph osd tier remove-overlay storage
there is now (or already was) no overlay for 'storage'
4)、剥离缓存池
# ceph osd tier remove storage cache
pool 'cache' is now (or already was) not a tier of 'storage'
1)、新建缓冲池,其中,cache作为sata-pool的前端高速缓冲池。
# ceph osd pool create storage 64
pool 'storage' created
# ceph osd pool create cache 64
pool 'cache' created
2)、设定缓冲池读写策略为写回模式。
ceph osd tier cache-mode cache writeback
3)、把缓存层挂接到后端存储池上
# ceph osd tier add storage cache
pool 'cache' is now (or already was) a tier of 'storage'
4)、将客户端流量指向到缓存存储池
# ceph osd tier set-overlay storage cache
overlay for 'storage' is now (or already was) 'cache'
2、调整Cache tier配置
1)、设置缓存层hit_set_type使用bloom过滤器
# ceph osd pool set cache hit_set_type bloom
set pool 27 hit_set_type to bloom
命令格式如下:
ceph osd pool set {cachepool} {key} {value}
关于Bloom-Filte算法原理可参见:
https://blog.csdn.net/jiaomeng/article/details/1495500
2)、设置hit_set_count、hit_set_period
# ceph osd pool set cache hit_set_count 1
set pool 27 hit_set_count to 1
# ceph osd pool set cache hit_set_period 3600
set pool 27 hit_set_period to 3600
# ceph osd pool set cache target_max_bytes 1000000000000
set pool 27 target_max_bytes to 1000000000000
默认情况下缓冲池基于数据的修改时间来进行确定是否命中缓存,也可以设定热度数hit_set_count和热度周期hit_set_period,以及最大缓冲数据target_max_bytes。 hit_set_count 和 hit_set_period 选项分别定义了 HitSet 覆盖的时间区间、以及保留多少个这样的 HitSet,保留一段时间以来的访问记录,这样 Ceph 就能判断一客户端在一段时间内访问了某对象一次、还是多次(存活期与热度)。
3)、设置min_read_recency_for_promete、min_write_recency_for_promote
# ceph osd pool set cache min_read_recency_for_promote 1
set pool 27 min_read_recency_for_promote to 1
# ceph osd pool set cache min_write_recency_for_promote 1
set pool 27 min_write_recency_for_promote to 1
缓存池容量控制 先讲解个概念缓存池代理层两大主要操作
•刷写(flushing):负责把已经被修改的对象写入到后端慢存储,但是对象依然在缓冲池。
•驱逐(evicting):负责在缓冲池里销毁那些没有被修改的对象。
缓冲池代理层进行刷写和驱逐的操作,主要和缓冲池本身的容量有关。在缓冲池里,如果被修改的数据达到一个阈值(阈值(容量百分比),缓冲池代理就开始把这些数据刷写到后端慢存储。当缓冲池里被修改的数据达到40%时,则触发刷写动作。
# ceph osd pool set cache cache_target_dirty_ratio 0.4
当被修改的数据达到一个确定的阈值(容量百分比),刷写动作将会以高速运作。例如,当缓冲池里被修改数据达到60%时候,则高速刷写。
# ceph osd pool set cache cache_target_dirty_high_ratio 0.6
缓冲池的代理将会触发驱逐操作,目的是释放缓冲区空间。例如,当缓冲池里的容量使用达到80%时候,则触发驱逐操作。
# ceph osd pool set cache cache_target_full_ratio 0.8
除了上面提及基于缓冲池的百分比来判断是否触发刷写和驱逐,还可以指定确定的数据对象数量或者确定的数据容量。对缓冲池设定最大的数据容量,来强制触发刷写和驱逐操作。
# ceph osd pool set cache target_max_bytes 1073741824
同时,也可以对缓冲池设定最大的对象数量。在默认情况下,RBD的默认对象大小为4MB,1GB容量包含256个4MB的对象,则可以设定:
# ceph osd pool set cache target_max_objects 256
4)、缓冲池的数据刷新问题在缓冲池里,对象有最短的刷写周期。若被修改的对象在缓冲池里超过最短周期,将会被刷写到慢存储池。
# ceph osd pool set cache cache_min_flush_ age 600
注意:单位是分钟
设定对象最短的驱逐周期。
# ceph osd pool set cache cache_min_evict_age 1800
3、删除缓存层 删除readonly缓存 1)、把缓存模式改为 none 即可禁用。
ceph osd tier cache-mode {cachepool} none
2)、去除后端存储池的缓存池。
ceph osd tier remove {storagepool} {cachepool}
删除writeback缓存 1)、把缓存模式改为 forward ,这样新的和更改过的对象将直接刷回到后端存储池
# ceph osd tier cache-mode cache forward --yes-i-really-mean-it
set cache-mode for pool 'cache' to forward
2)、确保缓存池已刷回,可能要等数分钟
# rados ls -p cache
可以通过以下命令进行手动刷回
# rados -p cache cache-flush-evict-all
3)、取消流量指向缓存池
# ceph osd tier remove-overlay storage
there is now (or already was) no overlay for 'storage'
4)、剥离缓存池
# ceph osd tier remove storage cache
pool 'cache' is now (or already was) not a tier of 'storage'
如果您的问题仍未解决,还可以加入服务器在线技术交流QQ群:8017413寻求帮助。
相关内容
最新热点内容
推荐内容