]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: configurable threshold for reaping dead connections
authorSage Weil <sage@newdream.net>
Wed, 19 May 2021 19:23:26 +0000 (15:23 -0400)
committerGerald Yang <gerald.yang.tw@gmail.com>
Mon, 27 Sep 2021 07:32:24 +0000 (07:32 +0000)
It is helpful to set this to 1 for tests.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 8129d6bb953015cc05db458afa6aa9b8f5f62614)
Signed-off-by: Gerald Yang <gerald.yang.tw@gmail.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/msg/async/AsyncMessenger.h

index 1a69f141141ade88c67e5b5f0c0a1a04659be2c0..832af68a8ef477dbccb6ec4153404faaea43f0e5 100644 (file)
@@ -143,6 +143,7 @@ OPTION(ms_dump_on_send, OPT_BOOL)           // hexdump msg to log on send
 OPTION(ms_dump_corrupt_message_level, OPT_INT)  // debug level to hexdump undecodeable messages at
 OPTION(ms_async_op_threads, OPT_U64)            // number of worker processing threads for async messenger created on init
 OPTION(ms_async_max_op_threads, OPT_U64)        // max number of worker processing threads for async messenger
+OPTION(ms_async_reap_threshold, OPT_U32)        // number of deleted connections before we reap
 OPTION(ms_async_rdma_device_name, OPT_STR)
 OPTION(ms_async_rdma_enable_hugepage, OPT_BOOL)
 OPTION(ms_async_rdma_buffer_size, OPT_INT)
index daaeb2d7c9557d96361f5a227218a326fea0a718..d0d19ec702a0ad0b50799dec8b2534bc2eaed48a 100644 (file)
@@ -1135,6 +1135,11 @@ std::vector<Option> get_global_options() {
     .set_description("Maximum threadpool size of AsyncMessenger")
     .add_see_also("ms_async_op_threads"),
 
+    Option("ms_async_reap_threshold", Option::TYPE_UINT, Option::LEVEL_DEV)
+    .set_default(5)
+    .set_min(1)
+    .set_description("number of deleted connections before we reap"),
+
     Option("ms_async_rdma_device_name", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("")
     .set_description(""),
index 3ce1b61ce604784663ac3ae743bd2e67313ed940..140ad7fca98cfb719f04f9affb07a29d3bc59e10 100644 (file)
@@ -209,8 +209,6 @@ private:
   entity_addrvec_t _filter_addrs(const entity_addrvec_t& addrs);
 
  private:
-  static const uint64_t ReapDeadConnectionThreshold = 5;
-
   NetworkStack *stack;
   std::vector<Processor*> processors;
   friend class Processor;
@@ -404,7 +402,7 @@ public:
     deleted_conns.emplace(std::move(conn));
     conn->unregister();
 
-    if (deleted_conns.size() >= ReapDeadConnectionThreshold) {
+    if (deleted_conns.size() >= cct->_conf->ms_async_reap_threshold) {
       local_worker->center.dispatch_event_external(reap_handler);
     }
   }