mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Disable pathfinding indexing on validator nodes:
The pathfinding engine requires pre-building large tables which is a
resource-intensive operation. Typically, one would not expect that a
server configured as a validator would also support pathfinding APIs
and so, building those tables by default wastes resources.
This commit, if merged, will disable pathfinding on servers that are
configured as validators, unless the server operator opts to support
it explicitly, by configuring the `[path_search_max]` parameter.
Validator operators that wish to support pathfinding on a validator
and want to use the default values can add the following stanza to
their server's configuration file:
[path_search_max]
7
This commit is contained in:
@@ -62,17 +62,16 @@ OrderBookDB::setup(std::shared_ptr<ReadView const> const& ledger)
|
||||
mSeq = seq;
|
||||
}
|
||||
|
||||
if (app_.config().PATH_SEARCH_MAX == 0)
|
||||
if (app_.config().PATH_SEARCH_MAX != 0)
|
||||
{
|
||||
// nothing to do
|
||||
if (app_.config().standalone())
|
||||
update(ledger);
|
||||
else
|
||||
app_.getJobQueue().addJob(
|
||||
jtUPDATE_PF, "OrderBookDB::update", [this, ledger](Job&) {
|
||||
update(ledger);
|
||||
});
|
||||
}
|
||||
else if (app_.config().standalone())
|
||||
update(ledger);
|
||||
else
|
||||
app_.getJobQueue().addJob(
|
||||
jtUPDATE_PF, "OrderBookDB::update", [this, ledger](Job&) {
|
||||
update(ledger);
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -160,7 +160,18 @@ public:
|
||||
std::size_t PEERS_OUT_MAX = 0;
|
||||
std::size_t PEERS_IN_MAX = 0;
|
||||
|
||||
// Path searching
|
||||
// Path searching: these were reasonable default values at some point but
|
||||
// further research is needed to decide if they still are
|
||||
// and whether all of them are needed.
|
||||
//
|
||||
// The performance and resource consumption of a server can
|
||||
// be dramatically impacted by changing these configuration
|
||||
// options; higher values result in exponentially higher
|
||||
// resource usage.
|
||||
//
|
||||
// Servers operating as validators disable path finding by
|
||||
// default by setting the `PATH_SEARCH_MAX` option to 0
|
||||
// unless it is explicitly set in the configuration file.
|
||||
int PATH_SEARCH_OLD = 7;
|
||||
int PATH_SEARCH = 7;
|
||||
int PATH_SEARCH_FAST = 2;
|
||||
|
||||
@@ -615,6 +615,11 @@ Config::loadFromString(std::string const& fileContents)
|
||||
FETCH_DEPTH = 10;
|
||||
}
|
||||
|
||||
// By default, validators don't have pathfinding enabled, unless it is
|
||||
// explicitly requested by the server's admin.
|
||||
if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
|
||||
PATH_SEARCH_MAX = 0;
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
|
||||
PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
|
||||
if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
|
||||
|
||||
Reference in New Issue
Block a user