Skip to content
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

perf(puller): reduce historical sync workload #4000

Merged
merged 8 commits into from
Apr 17, 2023
Merged

Conversation

istae
Copy link
Member

@istae istae commented Apr 11, 2023

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

When the neighborhood size is large, node have to sync with many peers that ultimately respond with the same chunks because reserves are identical across neighborhoods. It is wasteful to have to sync with ALL of the neighbors at the SAME time.

So, we can limit the amount of parallel hist sync jobs and that should reduce the intensity of the initial syncing.

Since reserves are identical across neighborhoods (we get the same chunk from different peers), the time to find a stable storage radius does not get affected.

This change also propagates through the network because peers now have to respond to fewer sync requests.

At the end, we still complete historical syncing with every neighbor.

The depthmonitor wake up interval is also increased.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

@istae istae changed the title perf: reduce redundant historical sync workload perf(puller): reduce redundant historical sync workload Apr 12, 2023
@istae istae changed the title perf(puller): reduce redundant historical sync workload perf(puller): reduce historical sync workload Apr 12, 2023
@istae istae marked this pull request as ready for review April 12, 2023 10:40
@istae istae requested review from a team, mrekucci, acha-bill and aloknerurkar and removed request for a team April 12, 2023 10:40
case <-ctx.Done():
loggerV2.Debug("histSyncWorker context cancelled", "peer_address", peer, "bin", bin, "cursor", cur)
return
case p.activeHistoricalJobs <- struct{}{}:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is the main purpose of the activeHistoricalJobs channel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's to limit the number of sync jobs that are inflight

@istae istae merged commit 1de8ac0 into master Apr 17, 2023
@istae istae deleted the reduce-puller-work branch April 17, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants