MB-24055: Allow HashtableResizerTask interval to be customized 11/77711/3
authorDave Rigby <daver@couchbase.com>
Thu, 4 May 2017 10:21:55 +0000 (11:21 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 9 May 2017 09:52:52 +0000 (09:52 +0000)
Add a new entry to configuration.json: ht_resize_interval. This
controls how often the HashtableResizerTask should be scheduled to
check if the HashTables need resizing.

Change-Id: Icf312269079956a52bbe1ccdce358804839c4ff9
Reviewed-on: http://review.couchbase.org/77711
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
configuration.json
src/htresizer.cc
tests/ep_testsuite.cc

index 0b10aa8..f90692d 100644 (file)
             "default": "47",
             "type": "size_t"
         },
+        "ht_resize_interval": {
+            "default": "60",
+            "descr": "Interval in seconds to wait between HashtableResizerTask executions.",
+            "type": "size_t"
+        },
         "ht_size": {
             "default": "0",
             "type": "size_t"
index 34e0dbe..6296a08 100644 (file)
@@ -17,8 +17,8 @@
 
 #include "config.h"
 
+#include "ep_engine.h"
 #include "htresizer.h"
-
 #include "kv_bucket_iface.h"
 
 #include <phosphor/phosphor.h>
@@ -26,8 +26,6 @@
 
 #include <memory>
 
-static const double FREQUENCY(60.0);
-
 /**
  * Look at all the hash tables and make sure they're sized appropriately.
  */
@@ -55,6 +53,6 @@ bool HashtableResizerTask::run(void) {
                  "Hashtable resizer",
                  TaskId::HashtableResizerVisitorTask);
 
-    snooze(FREQUENCY);
+    snooze(engine->getConfiguration().getHtResizeInterval());
     return true;
 }
index 9ccf959..93df30a 100644 (file)
@@ -6482,6 +6482,7 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_hlc_drift_ahead_threshold_us",
                 "ep_hlc_drift_behind_threshold_us",
                 "ep_ht_locks",
+                "ep_ht_resize_interval",
                 "ep_ht_size",
                 "ep_initfile",
                 "ep_item_num_based_new_chk",
@@ -6667,6 +6668,7 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_hlc_drift_ahead_threshold_us",
                 "ep_hlc_drift_behind_threshold_us",
                 "ep_ht_locks",
+                "ep_ht_resize_interval",
                 "ep_ht_size",
                 "ep_initfile",
                 "ep_io_compaction_read_bytes",