.set_default(100)
.set_description("minimum number of capabilities a client may hold"),
+ Option("mds_min_caps_working_set", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+ .set_default(10000)
+ .set_flag(Option::FLAG_RUNTIME)
+ .set_description("number of capabilities a client may hold without cache pressure warnings generated"),
+
Option("mds_max_caps_per_client", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1_M)
.set_description("maximum number of capabilities a client may hold"),
set<Session*> sessions;
mds->sessionmap.get_client_session_set(sessions);
+ const auto min_caps_working_set = g_conf().get_val<uint64_t>("mds_min_caps_working_set");
const auto recall_warning_threshold = g_conf().get_val<Option::size_t>("mds_recall_warning_threshold");
const auto max_completed_requests = g_conf()->mds_max_completed_requests;
const auto max_completed_flushes = g_conf()->mds_max_completed_flushes;
std::list<MDSHealthMetric> late_recall_metrics;
std::list<MDSHealthMetric> large_completed_requests_metrics;
for (auto& session : sessions) {
+ const uint64_t num_caps = session->get_num_caps();
const uint64_t recall_caps = session->get_recall_caps();
- if (recall_caps > recall_warning_threshold) {
+ if (recall_caps > recall_warning_threshold && num_caps > min_caps_working_set) {
dout(2) << "Session " << *session <<
" is not releasing caps fast enough. Recalled caps at " << recall_caps
<< " > " << recall_warning_threshold << " (mds_recall_warning_threshold)." << dendl;
return info.completed_flushes.count(tid);
}
+ uint64_t get_num_caps() const {
+ return caps.size();
+ }
+
unsigned get_num_completed_flushes() const { return info.completed_flushes.size(); }
unsigned get_num_trim_flushes_warnings() const {
return num_trim_flushes_warnings;