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

rafs: prefetch based on blob chunks rather than files #887

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

changweige
Copy link
Contributor

@changweige changweige commented Nov 23, 2022

Perform different policy for v5 format and v6 format as rafs v6's blobs are capable to download chunks and decompress them all by themselves. For rafs v6, directly perform chunk based full prefetch to reduce requests to container registry and P2P cluster.

From benchmark test results, we can see that this PR has the same performance as the master code with significantly decreased registry requests (440->219)

--- master code

{"repo": "golang", "bench": "golang:latestnydusv6zstd", "pull_time": " 1.675706", "create_time": " 0.857444", "run_time": " 5.065474", "elapsed": " 7.598624"}

Backend Type:       "registry"
Read Amount:        358525072 Bytes (341.91615295410156 MB)
Read Count:         440
Read Errors:        0

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Average Latency(millis): 116     118     113     112     122     134     162     165

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Request Count:           5       6       12      22      23      61      130     181

--- current v2.1

{"repo": "golang", "bench": "golang:latestnydusv6zstd", "pull_time": " 1.677908", "create_time": " 0.745518", "run_time": " 8.033772", "elapsed": " 10.457198"}

Backend Type:       "registry"
Read Amount:        355171173 Bytes (338.71762561798096 MB)
Read Count:         536
Read Errors:        0

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Average Latency(millis): 117     115     115     121     137     148     163     180

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Request Count:           57      45      21      9       5       48      266     85

--- This PR optimized

{"repo": "golang", "bench": "golang:latestnydusv6zstd", "pull_time": " 1.673026", "create_time": " 0.840420", "run_time": " 5.023351", "elapsed": " 7.536797"}
Backend Type:       "registry"
Read Amount:        350684863 Bytes (334.43914699554443 MB)
Read Count:         219
Read Errors:        0

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Average Latency(millis): 113     149     118     140     185     153     169     179

Block Sizes:             <1K     1K~     4K~     16K~    64K~    128K~   512K~   1M~
Request Count:           14      6       10      4       2       13      5       165

Signed-off-by: Changwei Ge gechangwei@bytedance.com

@changweige changweige changed the title rafs: prefetch based on blob chunks rather than files [wip] rafs: prefetch based on blob chunks rather than files Nov 23, 2022
@changweige changweige changed the title [wip] rafs: prefetch based on blob chunks rather than files rafs: prefetch based on blob chunks rather than files Nov 23, 2022
@changweige changweige marked this pull request as ready for review November 23, 2022 06:42
@changweige changweige force-pushed the 2.1-v6-blob-prefetch branch 2 times, most recently from 2a9ad1b to ba58a7d Compare November 23, 2022 07:00
storage/src/device.rs Outdated Show resolved Hide resolved
} else {
Ok(false)
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

md_v6.rs should only contains code for v6, so is this branch redundant?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like it's used for both v5 and v6, so it would be better to move into a common source file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Could we do the code movement on the master branch as I am planning to commit these changes to the master in the future?

rafs/src/fs.rs Outdated Show resolved Hide resolved
Perform different policy for v5 format and v6 format as rafs v6's blobs are capable to
to download chunks and decompress them all by themselves. For rafs v6, directly perform
chunk based full prefetch to reduce requests to container registry and
P2P cluster.

Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
@jiangliu
Copy link
Collaborator

Please also open a PR for master? It should also improve master branch:)

@yqleng1987
Copy link
Contributor

/retest

@changweige
Copy link
Contributor Author

Please also open a PR for master? It should also improve master branch:)

Sure. :-) Will raise another PR to master branch

@jiangliu jiangliu merged commit 4119e1c into dragonflyoss:stable/v2.1 Nov 29, 2022
@anolis-bot
Copy link
Collaborator

@yqleng1987 , The CI test is completed, please check result:

Test CaseTest Result
merge-target-branch✅ SUCCESS
build-docker-image✅ SUCCESS
compile-nydus✅ SUCCESS
compile-ctr-remote✅ SUCCESS
compile-nydus-snapshotter✅ SUCCESS
start-nydus-snapshotter-config-containerd✅ SUCCESS
run-container-with-nydus-image✅ SUCCESS

Congratulations, your test job passed!

@changweige changweige deleted the 2.1-v6-blob-prefetch branch December 10, 2022 05:36
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.

4 participants