-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Optimize block download tasks with a simple task scheduler #1999
Merged
Conversation
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
driftluo
requested review from
quake,
doitian,
keroro520,
zhangsoledad,
yangby-cryptape and
a team
April 3, 2020 07:38
driftluo
force-pushed
the
download-scheduler
branch
from
April 8, 2020 10:33
044f3dc
to
42fde19
Compare
quake
requested changes
Apr 9, 2020
driftluo
force-pushed
the
download-scheduler
branch
6 times, most recently
from
April 13, 2020 15:52
990661d
to
372c173
Compare
doitian
requested changes
Apr 14, 2020
driftluo
force-pushed
the
download-scheduler
branch
7 times, most recently
from
April 16, 2020 04:11
1d12b72
to
04f27aa
Compare
driftluo
force-pushed
the
download-scheduler
branch
3 times, most recently
from
April 16, 2020 12:39
21dd64b
to
942eef1
Compare
doitian
reviewed
Apr 20, 2020
doitian
previously approved these changes
Apr 20, 2020
driftluo
force-pushed
the
download-scheduler
branch
from
April 21, 2020 04:43
8010dfc
to
0829119
Compare
benchmark |
Benchmark Result
|
driftluo
force-pushed
the
download-scheduler
branch
from
April 21, 2020 05:27
0829119
to
8dee03d
Compare
benchmark |
Benchmark Result
|
driftluo
force-pushed
the
download-scheduler
branch
from
April 21, 2020 06:20
8dee03d
to
faf983a
Compare
benchmark |
Benchmark Result
|
quake
previously approved these changes
Apr 21, 2020
driftluo
force-pushed
the
download-scheduler
branch
from
April 28, 2020 02:47
faf983a
to
bf0583e
Compare
doitian
approved these changes
Apr 28, 2020
quake
approved these changes
Apr 28, 2020
bors r=quake, doitian |
Build succeeded:
|
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.
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:
When inserting a orphan block, the countdown for 1 second at the tip + 1 corresponding totrace_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)getBlockTransaction
task from thegetBlocks
task, keeping the design that getBlockTransaction can request from 2 nodesblock fetch
processgetblock
requests for 30 seconds< tip +1
block request if request window > tip + 512Test machine configuration:
2 core 8G RAM
IP Location on Hong Kong
before:
after: