stargz-snapshotter
stargz-snapshotter copied to clipboard
Prefetch optimization doesn't work
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.
Could you provide a reproducer of the issue?
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
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}-estargzThen 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 cntThe
ctr-remote rpulltime is around 0.2s, thectr createtime is around 0.05s, thectr starttime is 5s
Note that I pushed the ${img}-estargz to a private registry.
The stargz version I'm using is v0.14.3
@ktock Hi, could you reproduce it?
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.