From cd2a4b709c583f99b21a971b15831ddea2b95e18 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 12 Jan 2018 09:18:27 -0800 Subject: [PATCH] Reduce maximum batcn size for status updates but increase the number of whole record commit threads. --- controller/RethinkDB.cpp | 2 +- controller/RethinkDB.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/RethinkDB.cpp b/controller/RethinkDB.cpp index b7d045711..3f730efc5 100644 --- a/controller/RethinkDB.cpp +++ b/controller/RethinkDB.cpp @@ -280,7 +280,7 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Identity &myId,co tmpobj["ts"] = i->second.first; tmpobj["phy"] = i->second.second.toIpString(tmp2); batch.emplace_back(tmpobj); - if (batch.size() >= 1024) { + if (batch.size() >= 256) { R::db(this->_db).table("MemberStatus",R::optargs("read_mode","outdated")).insert(batch,R::optargs("conflict","update")).run(*rdb); batch.clear(); } diff --git a/controller/RethinkDB.hpp b/controller/RethinkDB.hpp index bce8bdefa..ab2611c03 100644 --- a/controller/RethinkDB.hpp +++ b/controller/RethinkDB.hpp @@ -23,7 +23,7 @@ #include "DB.hpp" -#define ZT_CONTROLLER_RETHINKDB_COMMIT_THREADS 2 +#define ZT_CONTROLLER_RETHINKDB_COMMIT_THREADS 8 namespace ZeroTier {