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

Downloading/encoding concurrency #2172

Merged
merged 7 commits into from
Oct 30, 2023
Merged

Conversation

nazar-pc
Copy link
Member

This PR aims to resolve #2027 by allowing next sector to be downloaded while the previous sector is being encoded.

All commits before the last one are just refactoring to enable necessary capabilities.

There are a few way to implement this, I decided to simply spawn background task and keep it in a variable to look into later.

As byproduct of refactoring subspace-farmer-components has become more flexible, but at the same time previous simple API is still present for convenience.

Code contributor checklist:

@nazar-pc nazar-pc added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit 31ab035 Oct 30, 2023
10 checks passed
@nazar-pc nazar-pc deleted the downloading/encoding-concurrency branch October 30, 2023 15:04
Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Make sense overall, just one nit.

Also, looks like we only concurrently downloading one sector, can it be more than one? or is that out of memory concern of the downloaded sector?

Copy link
Member Author

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Also, looks like we only concurrently downloading one sector, can it be more than one? or is that out of memory concern of the downloaded sector?

Memory usage will be excessive and generally we expect that downloading will be fast enough for this to not block encoding. With one farm you only download one sector ahead, but with multiple farms and --sector-downloading-concurrency increased from default value of 2, each farm can potentially download one sector ahead, but more than one per farm doesn't make a lot of sense and makes implementation tricky in terms of avoiding deadlocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download next sector while previous sector is being encoded/written
4 participants