Просмотр исходного кода

feat(emqx_conf_schema): add node.default_bootstrap_batch_size config parameter

Serge Tupchii 2 лет назад
Родитель
Сommit
e1456c1c04
2 измененных файлов с 20 добавлено и 0 удалено
  1. 10 0
      apps/emqx_conf/src/emqx_conf_schema.erl
  2. 10 0
      rel/i18n/emqx_conf_schema.hocon

+ 10 - 0
apps/emqx_conf/src/emqx_conf_schema.erl

@@ -674,6 +674,16 @@ fields("node") ->
                     default => #{}
                 }
             )},
+        {"default_bootstrap_batch_size",
+            sc(
+                pos_integer(),
+                #{
+                    mapping => "mria.bootstrap_batch_size",
+                    importance => ?IMPORTANCE_HIDDEN,
+                    default => 500,
+                    desc => ?DESC(db_default_bootstrap_batch_size)
+                }
+            )},
         {"broker_pool_size",
             sc(
                 pos_integer(),

+ 10 - 0
rel/i18n/emqx_conf_schema.hocon

@@ -776,6 +776,16 @@ the default is to use the value set in <code>db.default_shard_transport</code>."
 db_shard_transports.label:
 """Shard Transports"""
 
+db_default_bootstrap_batch_size.desc:
+"""The number of built-in database table records to be pushed in one chunk from a core node to a replicant node during bootstrap.
+The bootstrapping occurs when a new replicant node is added to the cluster or an existing replicant node reconnects to a core one.
+Increasing this value may greatly reduce a replicant node startup time, especially when EMQX cluster interconnect network latency is high
+and EMQX built-in database holds large amount of data, e.g. when the number of subscriptions is high.
+Defaults to 500."""
+
+db_default_bootstrap_batch_size.label:
+"""Default Bootstrap Batch Size"""
+
 node_broker_pool_size.desc:
 """The number of workers in emqx_broker pool. Increasing this value may improve performance
 by enhancing parallelism, especially when EMQX cluster interconnect network latency is high.