Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Increase raft append parallelism.

kishorenc5a67ffe2717c
diff --git a/src/raft_server.cpp b/src/raft_server.cpp
index 2ff060b6..886a9153 100644
--- a/src/raft_server.cpp
+++ b/src/raft_server.cpp
@@ -11,6 +11,8 @@
namespace braft {
DECLARE_int32(raft_do_snapshot_min_index_gap);
+ DECLARE_int32(raft_max_parallel_append_entries_rpc_num);
+ DECLARE_bool(raft_enable_append_entries_cache);
}
void ReplicationClosure::Run() {
@@ -41,6 +43,10 @@ int ReplicationState::start(const butil::EndPoint & peering_endpoint, const int
// do snapshot only when the gap between applied index and last snapshot index is >= this number
braft::FLAGS_raft_do_snapshot_min_index_gap = 1;
+ // parallelizes reads and writes
+ braft::FLAGS_raft_max_parallel_append_entries_rpc_num = 8;
+ braft::FLAGS_raft_enable_append_entries_cache = true;
+
node_options.election_timeout_ms = election_timeout_ms;
node_options.fsm = this;
node_options.node_owns_fsm = false;