containerd/overlaybd

how to known how much data has been downloaded for a dadi image

wxx213 opened this issue · 4 comments

I made a test for the overlaybd performance.

# create container
nerdctl run --snapshotter overlaybd -d --name test -v /opt/volume:/docker $dadi_image sleep 100000
# copy data, here the /usr directory cost most of the disk space for the image $dadi_image, and the /opt/volume directory belong to another disk.
time nerdctl exec -it test cp -r /usr/ /docker/

Then the time that the copy costs seems too little, so I suspect the overlaybd didn't downloaded all the data that the /usr directory really used.

At the same time, I found the cached data for the image $dadi_image in the cache directory is also too little.

Maybe the image has been downloaded in the local filesystem?
Check /var/log/overlaybd.log to find any words like 'overlaybd.commit'. Overlaybd will try to open localfile before lazy-loading from the network.

Maybe the image has been downloaded in the local filesystem? Check /var/log/overlaybd.log to find any words like 'overlaybd.commit'. Overlaybd will try to open localfile before lazy-loading from the network.

I cleaned the cache and image before the test to make overlaybd cannot use the old data.

When create the container, I see 17 logs like

bk_download.cpp:174|download_done:download done. rename(/opt/containerd/io.containerd.snapshotter.v1.overlaybd/snapshots/217/fs/overlaybd.download,/opt/containerd/io.containerd.snapshotter.v1.overlaybd/snapshots/217/fs/overlaybd.commit) success

This make the container creating slow, I seems the overlaybd didn't download the image on demand but download so much in container creating.

in /etc/overlaybd/overlaybd.json
{
....
"download": {
"enable": true, // set it to false will disable background download.
"delay": 120,
"delayExtra": 30,
"maxMBps": 100
},
...
}

and restart overlaybd-tcmu

It works, thanks.

What's more, is there any way to known what percent data has been downloaded for a image or the image blob?