Path workers, allow node operators to configure threads used#6667
Open
shortthefomo wants to merge 9 commits intoXRPLF:developfrom
Open
Path workers, allow node operators to configure threads used#6667shortthefomo wants to merge 9 commits intoXRPLF:developfrom
shortthefomo wants to merge 9 commits intoXRPLF:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Introduce a new configurable limit for pathfinding workers (
[path_workers]), replacing the previousjt_update_pf_limit. This allows administrators to control the maximum number of concurrently runningjtUPDATE_PFjobs in the JobQueue, which impacts path update and full order book update throughput. The limit is now capped at 3/4 of the configured[workers](rounded down), with a minimum cap of 2, to prevent system overload while allowing better utilization of available threads.Additionally, tie the number of pathfinding threads (
mPathFindThread) dynamically to the configured workers, ensuring scalability.This change does heavily impact a node CPU use when configured away from the default.
Context of Change
The pathfinding thread count is now tied to workers to avoid fixed low limits that don't scale. This improves performance on larger deployments while preventing resource exhaustion.
The core finding is that because pathfinding and order books updates are blocked behind a single thread, all other requests on todo that get stuck behind the slowest request. As xrpld stands today.
It is recommended that pathfinding nodes do run in memory mode along with this patch #6549
Every effort has been made to make sure the node is not starved when servicing large number of requests. Even so a validator should not be configuring their node to discover paths. This config is meant only for node setup to discover paths.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)No API impact - this is purely a configuration change.
Before / After
Before:
After:
[path_workers](default 2, max 3/4 of workers rounded down, min cap 2)Example: With
[workers] = 14, max[path_workers]is now 10 (vs. previous 1).Test Plan
To test: Set
[path_workers]to a value > 3/4 of[workers]and verify startup failure with appropriate error.Future Tasks
None - this completes the pathfinding worker configurability improvements.
*mixed up branches was working on and totally messed up #6604 so this PR is fixing that.