-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1999: feat: Optimize block download tasks with a simple task scheduler r=quake,doitian a=driftluo This implementation aims to optimize the task scheduling of the download block. It contains a simple task counter to allocate the number of tasks for each node, record and filter the relatively good nodes for download. After about a week of testing and continuous adjustments, the current PR data is relatively satisfactory, but the possibility of continued adjustments in the future is not ruled out This PR changes a number of things, including but not limited: 1. Raise the maximum inflight block limit per node to 32-128, but the default is 16, and dynamically adjust this data 2. Remove redundant designs where the same block can be requested from two nodes 3. ~When inserting a orphan block, the countdown for 1 second at the tip + 1 corresponding to `trace_number`, if still not completed, clear the task and send it to another node for download (exponentially decreasing the task limit of the corresponding node)~ 4. Split the `getBlockTransaction` task from the `getBlocks` task, keeping the design that getBlockTransaction can request from 2 nodes 5. Clearing out nodes that are peer_best_known < tip in IBD time 6. Separating the `block fetch` process 7. Clearing nodes that do not respond to `getblock` requests for 30 seconds 8. mark timeout on all `< tip +1` block request if request window > tip + 512 9. Reduce the consumption of checking the maximum timeout time, from check all inflight to check all Less than tip + 20 Test machine configuration: 2 core 8G RAM IP Location on Hong Kong ``` $ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 2 Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz ``` before: | net state | outbound | average speed | CPU occupancy | Bandwidth consumption | - | - | - | - | - | | relatively good | 8 peer | 102-120 block/s | average 70.49%, max 92.77% | average 4 Mbps, max 7.12 Mbps | relatively poor | 8 peer | 93-100 block/s | average 49.99%, max 74.37% | average 4 Mbps, max 7.12 Mbps after: | net state | outbound | average speed | CPU occupancy | Bandwidth consumption | - | - | - | - | - | | relatively good | 8 peer | 219-240 block/s | average 78.34%, max 93.17% | average 2Mbps, max 5.52 Mbps | relatively poor | 8 peer | 200-220 block/s | average 70.06%, max 85.83% | average 3 Mbps, max 19.55 Mbps Co-authored-by: driftluo <[email protected]>
- Loading branch information
Showing
15 changed files
with
734 additions
and
196 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.