OPTION(bluestore_compression_algorithm, OPT_STR, "snappy")
OPTION(bluestore_compression_min_blob_size, OPT_U32, 128*1024)
OPTION(bluestore_compression_max_blob_size, OPT_U32, 512*1024)
+/*
+ * Specifies minimum expected amount of saved allocation units
+ * per single blob to enable compressed blobs garbage collection
+ *
+ */
+OPTION(bluestore_gc_enable_blob_threshold, OPT_INT, 0)
+/*
+ * Specifies minimum expected amount of saved allocation units
+ * per all blobsb to enable compressed blobs garbage collection
+ *
+ */
+OPTION(bluestore_gc_enable_total_threshold, OPT_INT, 0)
+
OPTION(bluestore_max_blob_size, OPT_U32, 512*1024)
/*
* Require the net gain of compression at least to be at this ratio,
<< " expected4release=" << blob_expected_for_release
<< " expected_allocations=" << bi.expected_allocations
<< dendl;
- if (blob_expected_for_release >= bi.expected_allocations) {
+ int64_t benefit = blob_expected_for_release - bi.expected_allocations;
+ if (benefit >= g_conf->bluestore_gc_enable_blob_threshold) {
if (bi.collect_candidate) {
auto it = bi.first_lextent;
bool bExit = false;
GarbageCollector gc(c->store->cct);
int64_t benefit = gc.estimate(offset,
length,
- o->extent_map,
- wctx->old_extents,
- min_alloc_size);
- if (benefit > 0) {
+ o->extent_map,
+ wctx->old_extents,
+ min_alloc_size);
+ if (benefit > g_conf->bluestore_gc_enable_total_threshold) {
auto& extents_to_collect = gc.get_extents_to_collect();
for (auto it = extents_to_collect.begin();
it != extents_to_collect.end();
return;
g_conf->set_val("bluestore_compression_mode", "force");
g_conf->set_val("bluestore_min_alloc_size", "65536");
+
+ // just a big number to disble gc
+ g_conf->set_val("bluestore_gc_enable_total_threshold", "100000");
g_ceph_context->_conf->apply_changes(NULL);
int r = store->umount();
ASSERT_EQ(r, 0);
ASSERT_EQ( 0u, statfs.compressed);
ASSERT_EQ( 0u, statfs.compressed_allocated);
}
+ g_conf->set_val("bluestore_gc_enable_total_threshold", "0");
g_conf->set_val("bluestore_compression_mode", "none");
g_conf->set_val("bluestore_min_alloc_size", "0");
g_ceph_context->_conf->apply_changes(NULL);