-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Slow image pulling when using VZ VM type #648
Comments
Hi, thanks for reporting. |
No problems 🙂 No it's always slow to pull all images (and layers). I also tried to debug inside a container but while it did feel slow, it didn't feel that slow to curl/ping google. I could do a bit more tests and get precise numbers if needed. |
Just installed Colima 1st time and noticed the same problem. My setup is identical to yours. |
Same for me, just installed to try the performance with With brew:
|
I have done some tests and I think it might be related to DNS and IPv6,
when using ping:
requires over 1 second for just one ping command to finish executing (takes quite long to even start9. if forcing ping with IPv4:
it takes way about 0.2 seconds for everything to finish. And if I do a docker pull:
if I override the default DNS with google dns:
ping without forcing IP v4:
results in basically the same response as before upon forcing IP v4. This also matches the docker pull results:
Not sure if the issue is in colima directly or maybe lima? if the second, somebody should create an issue there, if no such issue exists. However, specifying the correct DNS manually might not be that easy all the time as might change depending on the local/corporate network or VPN. Though I guess for the colima VM itself that might not matter - except if there is a private docker registry that is only reachable using the correct DNS server 😄 |
OK. I have done some more testing and the best solution seems to supply Also applying dns does not seem to change the file at all after initial instance creation but it still seems to fix the slow dns resolution upon sub-sequent starts. So e.g.:
|
Hi @abiosoft any idea regarding an official fix here that does not require to set the dns on start? or do you know if this might actually be a lima issue? |
@AndreasA I am wondering why you need to set the DNS to Or this could possibly be an ipv6 issue and maybe try this workaround #686 (comment). |
@abiosoft it is most likely an IPv6 issue. Specifying the DNS solves it. It doesn't matter what is supplied (probably as long as an IPv4 address is used), so supplying the default IP works as well. However, my setup already uses link-local for network settings and the issue still occurs. For some reason specifying the DNS manually solves it, even if it is set to the default DNS. Not 100% sure why setting it to e.g. the default works as well, but according to ping tests it seems IPv6 related. |
Maybe we could have IPv6 disabled by default, as is tradition. |
@abiosoft I noticed that if otherwise great work with colima so far. it works way better (especially regarding performance) than docker desktop 😄 of course there are still seem issues like this one (for now), but mostly it works quite well. |
Sadly I just noticed that the
so it is probably better to keep the slower pull times for now. |
Seems related to lima-vm/lima#1333 . |
One thing I noticed is that providing any DNS resolver via colima/environment/vm/lima/yaml.go Line 73 in 6251dc2
I read others are reporting that the use of Lima's host resolver with |
Thanks for the writeup @AndreasA ! I was also able to repro the problem and fix following your steps. Just adding a +1 here. I'm def not a docker expert, but could tell something was off for the last month+, enough to finally start googling. This is a pretty huge usability impact, especially if using docker compose and using large images. We run a kafka cluster locally and those images are large. I was seeing a lot of connection timeouts talking to registries and downloading images seemed slower than it should have been. With the 8.8.8.8 workaround above, the speed of getting everything up and running from a cold cache is night and day different. Feels like it should. Should this workaround be documented somewhere in the README/docs until the upstream fix has been figured out? |
It sounds like this is fixed now on lima's master branch: lima-vm/lima#1333 (comment) However, I did notice that upgrading lima to this commit causes DNS to stop working in VMs that were already created on an old version. It sounds like a possible fix for this is under investigation. |
The DNS issue appears to be fixed in lima's master branch, but I ran into a problem where upgrading lima breaks DNS for an existing colima VM: lima-vm/lima#1783 The lima maintainers seem to think this is a colima-specific issue, but I'm a bit out of my depth trying to figure out the details. @abiosoft, would you be able to take a look at this? |
(@abiosoft: Also let me know if it's better to file a separate issue for the lima upgrade problem mentioned above, as it seems it may not be connected...) |
@aaronlehmann I would recommend opening a separate issue for that. Thanks. |
Sure thing! I've opened #827. |
since lima 0.18.x update this seems to work fine (also another person confirmed it seems to work on their M2 too, where there were a lot of issues prior). does anyone else still have issues here, if not maybe the issue could be closed with a corresponding information? |
* build: Lock GitHub runners' OS This was motivated by our macOS jobs failing [2] because colima is missing. It looks like this is because the latest versions of the macOS runner no longer have colima installed by default [1]. colima is now explicitly installed. [1] actions/runner-images#6216 [2] `/Users/runner/work/_temp/f19ffbff-27a9-4fc7-80b6-97791d2de141.sh: line 9: colima: command not found` * build: Lock Colima * build: Move macOS Docker installation to script * build: Move macOS libomp activation to script * build: Use latest Colima The > 0.6.0 releases actually fix the issue we have linked [1][2][3]. [1] abiosoft/colima#577 [2] https://github.com/jesse-c/MLServer/blob/c3acd60995a72141027eff506e4fd330fe824179/hack/install-docker-macos.sh#L18-L20 [3] > Switch to new user-v2 network. Fixes abiosoft/colima#648, abiosoft/colima#603, abiosoft/colima#577, abiosoft/colima#779, abiosoft/colima#137, abiosoft/colima#740.
Description
Pulling images is very slow when I set the VM type to VZ.
On the docker hello world image, running it from a clean colima instances takes 3 seconds using the default parameters, and 17 seconds when
--vm-type=vz
is set. It looks like the time is spent initiating the connection because the download speed looks fine. Could be a slow DNS query, a slow TCP handshake, a slow TLS handshake, I don't know.Version
Colima Version:
0.5.4
Lima Version:
0.15.0
Qemu Version:
7.2.0
Operating System
macOS M1 >= 13 (Ventura)
Output of
colima status
Reproduction Steps
colima start --cpu 4 --memory 4
time docker run -it --rm hello-world
colima delete
colima start --cpu 4 --memory 4 --vm-type=vz
time docker run -it --rm hello-world
colima delete
Expected behaviour
The duration of pulling and running the hello-world image should be similar.
Additional context
No response
The text was updated successfully, but these errors were encountered: