Skip to content

Commit

Permalink
OSD: allow client throttler to be adjusted on-fly, without restart
Browse files Browse the repository at this point in the history
This patch allows the osd_client_message_cap and
osd_client_message_size_cap to be adjusted on-fly, using admin socket
functionality.

Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
  • Loading branch information
branch-predictor committed Feb 1, 2017
1 parent ce8edcf commit 7892162
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/osd/OSD.cc
Expand Up @@ -9176,6 +9176,8 @@ const char** OSD::get_tracked_conf_keys() const
"host",
"fsid",
"osd_recovery_delay_start",
"osd_client_message_size_cap",
"osd_client_message_cap",
NULL
};
return KEYS;
Expand Down Expand Up @@ -9239,6 +9241,21 @@ void OSD::handle_conf_change(const struct md_config_t *conf,
service.kick_recovery_queue();
}

if (changed.count("osd_client_message_cap")) {
uint64_t newval = cct->_conf->osd_client_message_cap;
Messenger::Policy pol = client_messenger->get_policy(entity_name_t::TYPE_CLIENT);
if (pol.throttler_messages && newval > 0) {
pol.throttler_messages->reset_max(newval);
}
}
if (changed.count("osd_client_message_size_cap")) {
uint64_t newval = cct->_conf->osd_client_message_size_cap;
Messenger::Policy pol = client_messenger->get_policy(entity_name_t::TYPE_CLIENT);
if (pol.throttler_bytes && newval > 0) {
pol.throttler_bytes->reset_max(newval);
}
}

check_config();
}

Expand Down

0 comments on commit 7892162

Please sign in to comment.