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

Prefetch optimization doesn't work #1211

Open
jzh18 opened this issue Apr 18, 2023 · 6 comments
Open

Prefetch optimization doesn't work #1211

jzh18 opened this issue Apr 18, 2023 · 6 comments

Comments

@jzh18
Copy link

jzh18 commented Apr 18, 2023

Hi I tested estargz with prefetch optimization. But it seems doesn't works as the container run time is always longer than the create time.

@ktock
Copy link
Member

ktock commented Apr 18, 2023

Could you provide a reproducer of the issue?

@jzh18
Copy link
Author

jzh18 commented Apr 18, 2023

Could you provide a reproducer of the issue?

Here is the command I used to optimize the image:

sudo systemctl enable --now stargz-snapshotter
sudo systemctl start stargz-snapshotter
sudo systemctl restart containerd

img=mysql:8.0.24

mkdir /tmp/t1
mkdir /tmp/t2
sudo ctr-remote image optimize --oci  -period 10 \
           --entrypoint='[ "mysqld"]' --args='["--initialize"]'  \
		   --mount type=bind,src=/tmp/t1,dst=/var/lib/mysql,options=bind:rw \
  	       --mount type=bind,src=/tmp/t2,dst=/run/mysqld,options=bind:rw \
           ${img} \
           ${img}-estargz

Then I test the estargz image with the following command:

sudo ctr-remote i rpull ${img}-estargz
sudo ctr c create --snapshotter=stargz \
  --mount type=bind,src=/tmp/t1,dst=/var/lib/mysql,options=bind:rw \
  --mount type=bind,src=/tmp/t2,dst=/run/mysqld,options=bind:rw \
  ${img}-estargz cnt mysqld --initialize
sudo ctr task start cnt

The ctr-remote rpull time is around 0.2s, the ctr create time is around 0.05s, the ctr start time is 5s

@jzh18
Copy link
Author

jzh18 commented Apr 18, 2023

Note that I pushed

Could you provide a reproducer of the issue?

Here is the command I used to optimize the image:

sudo systemctl enable --now stargz-snapshotter
sudo systemctl start stargz-snapshotter
sudo systemctl restart containerd

img=mysql:8.0.24

mkdir /tmp/t1
mkdir /tmp/t2
sudo ctr-remote image optimize --oci  -period 10 \
           --entrypoint='[ "mysqld"]' --args='["--initialize"]'  \
		   --mount type=bind,src=/tmp/t1,dst=/var/lib/mysql,options=bind:rw \
  	       --mount type=bind,src=/tmp/t2,dst=/run/mysqld,options=bind:rw \
           ${img} \
           ${img}-estargz

Then I test the estargz image with the following command:

sudo ctr-remote i rpull ${img}-estargz
sudo ctr c create --snapshotter=stargz \
  --mount type=bind,src=/tmp/t1,dst=/var/lib/mysql,options=bind:rw \
  --mount type=bind,src=/tmp/t2,dst=/run/mysqld,options=bind:rw \
  ${img}-estargz cnt mysqld --initialize
sudo ctr task start cnt

The ctr-remote rpull time is around 0.2s, the ctr create time is around 0.05s, the ctr start time is 5s

Note that I pushed the ${img}-estargz to a private registry.

@jzh18
Copy link
Author

jzh18 commented Apr 18, 2023

The stargz version I'm using is v0.14.3

@jzh18
Copy link
Author

jzh18 commented Apr 18, 2023

@ktock Hi, could you reproduce it?

@ktock
Copy link
Member

ktock commented Apr 25, 2023

the container run time is always longer than the create time.

Could you also provide your expected performance and your observed one? create time is just the latency to create the container so run time of the container can be longer than the container creation depending on the workload, which is not a problem itself. This can happen in both of lazy and non-lazy cases.

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

No branches or pull requests

2 participants