From 48a71e22e00c620d813769ee4384eb1e6842e967 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 11 Feb 2014 10:14:36 -0800 Subject: [PATCH] librbd: remove limit on number of objects in the cache The number of objects is not a significant indicated of when data should be written out for rbd. Use the highest possible value for number of objects and just rely on the dirty data limits to trigger flushing. When the number of objects is low, and many start being flushed before they accumulate many requests, it hurts average request size and performance for many concurrent sequential writes. Fixes: #7385 Backport: emperor, dumpling Signed-off-by: Josh Durgin (cherry picked from commit 0559d31db29ea83bdb6cec72b830d16b44e3cd35) --- src/librbd/ImageCtx.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 41518b67698cd..77cb8503ad63f 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -86,7 +86,7 @@ namespace librbd { object_cacher = new ObjectCacher(cct, pname, *writeback_handler, cache_lock, NULL, NULL, cct->_conf->rbd_cache_size, - 10, /* reset this in init */ + (uint64_t) -1, // unlimited number of objects init_max_dirty, cct->_conf->rbd_cache_target_dirty, cct->_conf->rbd_cache_max_dirty_age, @@ -182,14 +182,6 @@ namespace librbd { snprintf(format_string, len, "%s.%%016llx", object_prefix.c_str()); } - // size object cache appropriately - if (object_cacher) { - uint64_t obj = cct->_conf->rbd_cache_size / (1ull << order); - ldout(cct, 10) << " cache bytes " << cct->_conf->rbd_cache_size << " order " << (int)order - << " -> about " << obj << " objects" << dendl; - object_cacher->set_max_objects(obj * 4 + 10); - } - ldout(cct, 10) << "init_layout stripe_unit " << stripe_unit << " stripe_count " << stripe_count << " object_size " << layout.fl_object_size -- 2.39.5