OPTION(bluestore_extent_map_shard_target_size_slop, OPT_DOUBLE, .2)
OPTION(bluestore_extent_map_inline_shard_prealloc_size, OPT_U32, 256)
OPTION(bluestore_cache_type, OPT_STR, "2q") // lru, 2q
+OPTION(bluestore_2q_cache_kin_ratio, OPT_DOUBLE, .5) // kin page slot size / max page slot size
+OPTION(bluestore_2q_cache_kout_ratio, OPT_DOUBLE, .5) // number of kout page slot / total number of page slot
OPTION(bluestore_onode_cache_size, OPT_U32, 4*1024)
OPTION(bluestore_buffer_cache_size, OPT_U32, 512*1024*1024)
OPTION(bluestore_kvbackend, OPT_STR, "rocksdb")
// buffers
if (buffer_bytes > buffer_max) {
- uint64_t kin = buffer_max / 2;
- uint64_t khot = kin;
+ uint64_t kin = buffer_max * g_conf->bluestore_2q_cache_kin_ratio;
+ uint64_t khot = buffer_max - kin;
// pre-calculate kout based on average buffer size too,
// which is typical(the warm_in and hot lists may change later)
if (buffer_num) {
uint64_t buffer_avg_size = buffer_bytes / buffer_num;
assert(buffer_avg_size);
- kout = buffer_max / buffer_avg_size;
+ uint64_t caculated_buffer_num = buffer_max / buffer_avg_size;
+ kout = caculated_buffer_num * g_conf->bluestore_2q_cache_kout_ratio;
}
if (buffer_list_bytes[BUFFER_HOT] < khot) {