Skip to content

Commit

Permalink
config: distinguish ops with bytes for throttling
Browse files Browse the repository at this point in the history
Reported-by: Xin Yuan <[email protected]>
Signed-off-by: Li Wang <[email protected]>
  • Loading branch information
dragonylffly committed May 11, 2018
1 parent 5c4f8c7 commit 6363745
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/common/legacy_config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,16 @@ OPTION(filestore_queue_max_delay_multiple, OPT_DOUBLE)
/// Filestore high delay multiple. Defaults to 0 (disabled)
OPTION(filestore_queue_high_delay_multiple, OPT_DOUBLE)

/// Filestore max delay multiple bytes. Defaults to 0 (disabled)
OPTION(filestore_queue_max_delay_multiple_bytes, OPT_DOUBLE)
/// Filestore high delay multiple bytes. Defaults to 0 (disabled)
OPTION(filestore_queue_high_delay_multiple_bytes, OPT_DOUBLE)

/// Filestore max delay multiple ops. Defaults to 0 (disabled)
OPTION(filestore_queue_max_delay_multiple_ops, OPT_DOUBLE)
/// Filestore high delay multiple ops. Defaults to 0 (disabled)
OPTION(filestore_queue_high_delay_multiple_ops, OPT_DOUBLE)

/// Use above to inject delays intended to keep the op queue between low and high
OPTION(filestore_queue_low_threshhold, OPT_DOUBLE)
OPTION(filestore_queue_high_threshhold, OPT_DOUBLE)
Expand Down
16 changes: 16 additions & 0 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4533,6 +4533,22 @@ std::vector<Option> get_global_options() {
.set_default(0)
.set_description(""),

Option("filestore_queue_max_delay_multiple_bytes", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),

Option("filestore_queue_high_delay_multiple_bytes", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),

Option("filestore_queue_max_delay_multiple_ops", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),

Option("filestore_queue_high_delay_multiple_ops", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),

Option("filestore_queue_low_threshhold", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0.3)
.set_description(""),
Expand Down
16 changes: 12 additions & 4 deletions src/os/filestore/FileStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5948,17 +5948,25 @@ int FileStore::set_throttle_params()
cct->_conf->filestore_queue_low_threshhold,
cct->_conf->filestore_queue_high_threshhold,
cct->_conf->filestore_expected_throughput_bytes,
cct->_conf->filestore_queue_high_delay_multiple,
cct->_conf->filestore_queue_max_delay_multiple,
cct->_conf->filestore_queue_high_delay_multiple?
cct->_conf->filestore_queue_high_delay_multiple:
cct->_conf->filestore_queue_high_delay_multiple_bytes,
cct->_conf->filestore_queue_max_delay_multiple?
cct->_conf->filestore_queue_max_delay_multiple:
cct->_conf->filestore_queue_max_delay_multiple_bytes,
cct->_conf->filestore_queue_max_bytes,
&ss);

valid &= throttle_ops.set_params(
cct->_conf->filestore_queue_low_threshhold,
cct->_conf->filestore_queue_high_threshhold,
cct->_conf->filestore_expected_throughput_ops,
cct->_conf->filestore_queue_high_delay_multiple,
cct->_conf->filestore_queue_max_delay_multiple,
cct->_conf->filestore_queue_high_delay_multiple?
cct->_conf->filestore_queue_high_delay_multiple:
cct->_conf->filestore_queue_high_delay_multiple_ops,
cct->_conf->filestore_queue_max_delay_multiple?
cct->_conf->filestore_queue_max_delay_multiple:
cct->_conf->filestore_queue_max_delay_multiple_ops,
cct->_conf->filestore_queue_max_ops,
&ss);

Expand Down

0 comments on commit 6363745

Please sign in to comment.