desc: Enable health indication when spurious read errors are observed by OSD
default: true
with_legacy: true
+- name: bluestore_warn_on_free_fragmentation
+ type: float
+ level: basic
+ desc: Level at which disk free fragmentation causes health warning. Set "1" to disable.
+ This is same value as admin command "bluestore allocator score block".
+ default: 0.8
+ with_legacy: false
+ flags:
+ - runtime
+ see_also:
+ - bluestore_fragmentation_check_period
+- name: bluestore_fragmentation_check_period
+ type: uint
+ level: basic
+ desc: The period to perform bluestore free fragmentation check.
+ Checking fragmentation is usually almost immediate. For highly fragmented storage,
+ it can take several miliseconds. It can cause a stall to a write operation.
+ default: 3600
+ with_legacy: false
+ flags:
+ - runtime
+ see_also:
+ - bluestore_warn_on_free_fragmentation
- name: bluestore_slow_ops_warn_lifetime
type: uint
level: advanced
// MempoolThread
#undef dout_prefix
-#define dout_prefix *_dout << "bluestore.MempoolThread(" << this << ") "
+#define dout_prefix *_dout << "bluestore.MempoolThread "
#undef dout_context
#define dout_context store->cct
interval_stats_trim = false;
store->refresh_perf_counters();
+ uint64_t period = store->cct->_conf.get_val<uint64_t>("bluestore_fragmentation_check_period");
+ if (period != 0 && store->alloc) {
+ auto now = mono_clock::now();
+ timespan elapsed = now - last_fragmentation_check;
+ if (elapsed > make_timespan(period)) {
+ last_fragmentation_check = now;
+ double score;
+ score = store->alloc->get_fragmentation_score();
+ store->logger->set(l_bluestore_fragmentation, score * 1e6);
+ now = mono_clock::now();
+ elapsed = now - last_fragmentation_check;
+ auto seconds = elapsed.count() * 1e-9;
+ dout(0) << std::fixed << std::setprecision(6)
+ << "fragmentation_score=" << score << " took=" << seconds << "s" << dendl;
+ }
+ }
+
auto wait = ceph::make_timespan(
store->cct->_conf->bluestore_cache_trim_interval);
cond.wait_for(l, wait);
// this is as good a place as any ...
_reap_collections();
-
- logger->set(l_bluestore_fragmentation,
- (uint64_t)(alloc->get_fragmentation() * 1000));
-
log_latency("kv_final",
l_bluestore_kv_final_lat,
mono_clock::now() - start,
"BLUESTORE_NO_COMPRESSION",
s0);
}
+ if (logger->get(l_bluestore_fragmentation) >
+ cct->_conf.get_val<double>("bluestore_warn_on_free_fragmentation") * 1e6) {
+ alerts.emplace("BLUESTORE_FREE_FRAGMENTATION",
+ fmt::format("{0:.6f}", logger->get(l_bluestore_fragmentation) * 1e-6));
+ }
}
void BlueStore::_collect_allocation_stats(uint64_t need, uint32_t alloc_size,