]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make cache size health warning factor configurable 12443/head
authorJohn Spray <john.spray@redhat.com>
Mon, 12 Dec 2016 11:59:33 +0000 (11:59 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 12 Dec 2016 12:02:43 +0000 (12:02 +0000)
...now that it's used more than once place, copying around
the fraction was bad.

Signed-off-by: John Spray <john.spray@redhat.com>
src/common/config_opts.h
src/mds/Beacon.cc
src/mds/MDCache.cc

index 5695823ef315cc9a498fa6d281f52850434497de..ff57ccf45a86f90028abf47950b978be4d6a1a79 100644 (file)
@@ -491,6 +491,7 @@ OPTION(mds_recall_state_timeout, OPT_FLOAT, 60)    // detect clients which aren'
 OPTION(mds_freeze_tree_timeout, OPT_FLOAT, 30)    // detecting freeze tree deadlock
 OPTION(mds_session_autoclose, OPT_FLOAT, 300) // autoclose idle session
 OPTION(mds_health_summarize_threshold, OPT_INT, 10) // collapse N-client health metrics to a single 'many'
+OPTION(mds_health_cache_threshold, OPT_FLOAT, 1.5) // warn on cache size if it exceeds mds_cache_size by this factor
 OPTION(mds_reconnect_timeout, OPT_FLOAT, 45)  // seconds to wait for clients during mds restart
              //  make it (mds_session_timeout - mds_beacon_grace)
 OPTION(mds_tick_interval, OPT_FLOAT, 5)
index ec251fc24b2c976f5bdf48cc7beec8a13078d5de..285583b6780b0ec565fbe18290f426b7608d77ee 100644 (file)
@@ -482,7 +482,8 @@ void Beacon::notify_health(MDSRank const *mds)
   }
 
   // Report if we have significantly exceeded our cache size limit
-  if (mds->mdcache->get_num_inodes() > g_conf->mds_cache_size * 1.5) {
+  if (mds->mdcache->get_num_inodes() >
+        g_conf->mds_cache_size * g_conf->mds_health_cache_threshold) {
     std::ostringstream oss;
     oss << "Too many inodes in cache (" << mds->mdcache->get_num_inodes()
         << "/" << g_conf->mds_cache_size << "), "
index 89c8068bcfa657f8f830ac4babf3853214da222a..2d6e412b29f7923af1c94db2368ffd712cf503c3 100644 (file)
@@ -282,7 +282,8 @@ void MDCache::add_inode(CInode *in)
       base_inodes.insert(in);
   }
 
-  if (get_num_inodes() > g_conf->mds_cache_size * 1.5) {
+  if (get_num_inodes() >
+        g_conf->mds_cache_size * g_conf->mds_health_cache_threshold) {
     exceeded_size_limit = true;
   }
 }
@@ -7388,7 +7389,8 @@ void MDCache::check_memory_usage()
   // now, free any unused pool memory so that our memory usage isn't
   // permanently bloated.
   if (exceeded_size_limit
-      && get_num_inodes() <= g_conf->mds_cache_size * 1.5) {
+      && get_num_inodes() <=
+        g_conf->mds_cache_size * g_conf->mds_health_cache_threshold) {
     // Only do this once we are back in bounds: otherwise the releases would
     // slow down whatever process caused us to exceed bounds to begin with
     dout(2) << "check_memory_usage: releasing unused space from pool allocators"