Option("mds_client_writeable_range_max_inc_objs", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1024)
.set_description(""),
+
+ Option("mds_min_caps_per_client", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ .set_default(100)
+ .set_description("Set the minimum cache number of client"),
+
+ Option("mds_max_ratio_caps_per_client", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
+ .set_default(.8)
+ .set_description("Set the maximum cache number ratio of client"),
});
}
void Server::recall_client_state(void)
{
/* try to recall at least 80% of all caps */
- uint64_t max_caps_per_client = (Capability::count() * .8);
- uint64_t min_caps_per_client = 100;
+ uint64_t max_caps_per_client = (uint64_t)(Capability::count() * g_conf->get_val<float>("mds_max_ratio_caps_per_client"));
+ uint64_t min_caps_per_client = (uint64_t)g_conf->get_val<int>("mds_min_caps_per_client");
+ if (max_caps_per_client < min_caps_per_client) {
+ dout(0) << "max_caps_per_client " << max_caps_per_client
+ << "<" << "min_caps_per_client " << min_caps_per_client << dendl;
+ max_caps_per_client = min_caps_per_client + 1;
+ }
+
/* unless this ratio is smaller: */
/* ratio: determine the amount of caps to recall from each client. Use
* percentage full over the cache reservation. Cap the ratio at 80% of client