mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
os/bluestore: tune deferred_batch_ops separately for hdd and ssd
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
9967fceb62
commit
9e88a71105
@ -1111,7 +1111,9 @@ OPTION(bluestore_throttle_cost_per_io_ssd, OPT_U64, 4000)
|
||||
OPTION(bluestore_throttle_cost_per_io, OPT_U64, 0)
|
||||
OPTION(bluestore_deferred_max_ops, OPT_U64, 512)
|
||||
OPTION(bluestore_deferred_max_bytes, OPT_U64, 128*1024*1024)
|
||||
OPTION(bluestore_deferred_batch_ops, OPT_U64, 32)
|
||||
OPTION(bluestore_deferred_batch_ops, OPT_U64, 0)
|
||||
OPTION(bluestore_deferred_batch_ops_hdd, OPT_U64, 64)
|
||||
OPTION(bluestore_deferred_batch_ops_ssd, OPT_U64, 16)
|
||||
OPTION(bluestore_nid_prealloc, OPT_INT, 1024)
|
||||
OPTION(bluestore_blobid_prealloc, OPT_U64, 10240)
|
||||
OPTION(bluestore_clone_cow, OPT_BOOL, true) // do copy-on-write for clones
|
||||
|
@ -3252,6 +3252,9 @@ const char **BlueStore::get_tracked_conf_keys() const
|
||||
"bluestore_compression_max_blob_size",
|
||||
"bluestore_max_alloc_size",
|
||||
"bluestore_prefer_deferred_size",
|
||||
"bleustore_deferred_batch_ops",
|
||||
"bleustore_deferred_batch_ops_hdd",
|
||||
"bleustore_deferred_batch_ops_ssd",
|
||||
"bluestore_max_ops",
|
||||
"bluestore_max_bytes",
|
||||
"bluestore_deferred_max_ops",
|
||||
@ -3274,7 +3277,10 @@ void BlueStore::handle_conf_change(const struct md_config_t *conf,
|
||||
_set_compression();
|
||||
}
|
||||
if (changed.count("bluestore_prefer_deferred_size") ||
|
||||
changed.count("bluestore_max_alloc_size")) {
|
||||
changed.count("bluestore_max_alloc_size") ||
|
||||
changed.count("bluestore_deferred_batch_ops") ||
|
||||
changed.count("bluestore_deferred_batch_ops_hdd") ||
|
||||
changed.count("bluestore_deferred_batch_ops_ssd")) {
|
||||
if (bdev) {
|
||||
// only after startup
|
||||
_set_alloc_sizes();
|
||||
@ -3659,10 +3665,24 @@ void BlueStore::_set_alloc_sizes(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (cct->_conf->bluestore_deferred_batch_ops) {
|
||||
deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops;
|
||||
} else {
|
||||
assert(bdev);
|
||||
if (bdev->is_rotational()) {
|
||||
deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops_hdd;
|
||||
} else {
|
||||
deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops_ssd;
|
||||
}
|
||||
}
|
||||
|
||||
dout(10) << __func__ << " min_alloc_size 0x" << std::hex << min_alloc_size
|
||||
<< std::dec << " order " << min_alloc_size_order
|
||||
<< " max_alloc_size 0x" << std::hex << max_alloc_size
|
||||
<< std::dec << dendl;
|
||||
<< " prefer_deferred_size 0x" << prefer_deferred_size
|
||||
<< std::dec
|
||||
<< " deferred_batch_ops " << deferred_batch_ops
|
||||
<< dendl;
|
||||
}
|
||||
|
||||
int BlueStore::_open_bdev(bool create)
|
||||
@ -7919,7 +7939,7 @@ void BlueStore::_kv_sync_thread()
|
||||
|
||||
if (!deferred_aggressive) {
|
||||
std::lock_guard<std::mutex> l(deferred_lock);
|
||||
if (deferred_queue_size >= (int)g_conf->bluestore_deferred_batch_ops ||
|
||||
if (deferred_queue_size >= deferred_batch_ops ||
|
||||
throttle_deferred_bytes.past_midpoint()) {
|
||||
_deferred_try_submit();
|
||||
}
|
||||
|
@ -1789,6 +1789,7 @@ private:
|
||||
uint64_t min_alloc_size = 0; ///< minimum allocation unit (power of 2)
|
||||
size_t min_alloc_size_order = 0; ///< bits for min_alloc_size
|
||||
uint64_t prefer_deferred_size = 0; ///< size threshold for forced deferred writes
|
||||
int deferred_batch_ops = 0; ///< deferred batch size
|
||||
|
||||
uint64_t max_alloc_size = 0; ///< maximum allocation unit (power of 2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user