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

Poor Cache Hit Rate with Nydus + Dragonfly #3679

Open
zf930530 opened this issue Dec 3, 2024 · 6 comments
Open

Poor Cache Hit Rate with Nydus + Dragonfly #3679

zf930530 opened this issue Dec 3, 2024 · 6 comments
Assignees
Labels

Comments

@zf930530
Copy link

zf930530 commented Dec 3, 2024

Bug report:

I’ve noticed that when using Dragonfly to accelerate Nydus images, the cache hit rate is very poor, even after I preheat the images. During my investigation, I found that preheating caches the entire layer as a whole, and the generated taskID metadata does not include the Content-Range. However, when Nydus requests the image, its lazy-load mechanism causes each request to include a Content-Range. In this case, the calculated taskID does not match the preheated taskID, resulting in a cache miss.

What’s worse, even for the same image, the Content-Range in Nydus requests can vary between pulls, which further reduces the cache hit rate. Does the community have any plans to improve this situation? If so, could you share details about the proposed improvements?

Expected behavior:

Improving Cache Hit Rate for Nydus Images.

How to reproduce it:

Each time pulling Nydus images.

Environment:

  • Dragonfly version: 2.1.41
  • OS: centos 8
@zf930530 zf930530 added the bug label Dec 3, 2024
@zf930530
Copy link
Author

zf930530 commented Dec 4, 2024

I found this config: prefetch.
However when I set prefetch: true, back source still happened on seed-peer.

@zf930530 zf930530 closed this as completed Dec 4, 2024
@zf930530 zf930530 reopened this Dec 4, 2024
@gaius-qi
Copy link
Member

gaius-qi commented Dec 4, 2024

Please use rust client with helm chart(v2.1.64).

@gaius-qi gaius-qi self-assigned this Dec 5, 2024
@zf930530
Copy link
Author

zf930530 commented Dec 9, 2024

Hi,
I conducted tests using version 2.1.64 and converted a total of 8 Nydus images using the nydusify convert command, resulting in a total size of 4768MB. I then used the preheat URL to preheat the images, and observed that the seed-peer had successfully preheated the images.
Finally, when I pulled the images on the peer node, I used the iftop command to monitor the network traffic. I noticed 927MB of traffic from the seed-peer to the Harbor, with no back-to-source traffic on the peer node. Based on this, I calculated that approximately 20% of the traffic originated from the seed-peer's back-to-source actions.
Upon checking the seed-peer logs, I found that all back source headers included the Range header. Is this behavior expected?

@gaius-qi
Copy link
Member

@zf930530 How do you preheat? There are differences between the preheating of Nydus image and OCI image.

@zf930530
Copy link
Author

zf930530 commented Dec 10, 2024

curl --location --request POST 'http://dragonfly-manager-url/oapi/v1/jobs' --header 'Content-Type: application/json'
-- header 'Authorization: Bearer xxxxxx'
-- data-raw {
"type": "preheat",
"args": {
"type": "image",
"url": "https://harbor_url/v2/test/alpine/manifests/v1",
"filteredQueryParams": "Expires&Signature",
"username": "xxx",
"password": "xxx"
}
}

@gaius-qi
Copy link
Member

@zf930530 Can you provide all of the seed client logs(/var/log/dragonfly/dfdaemon/)?

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

No branches or pull requests

2 participants