ddev / ddev

Docker-based local PHP+Node.js web development environments
https://ddev.com
Apache License 2.0
2.52k stars 590 forks source link

Test out new colima options vz and virtiofs mounting #4466

Closed rfay closed 1 year ago

rfay commented 1 year ago

We need to test out the complexities and possibilities of colima v05.0 and what the heartaches are regarding DDEV.

75th commented 1 year ago

Tried to ddev import-db a large database using the new options. Both a 567 MB .sql file uncompressed, and the same data as a 75 MB gzip. Results:

qemu vz
virtiofs Done in 3 minutes Incredibly slow. ETA and import speed fluctuated widely, with completion estimates between 20 minutes and over an hour. With the gzipped file it took a longer time for the progress bar to even appear, and when it did it wasn't significantly faster than the uncompressed.
sshfs Done in 3 minutes Fails immediately with an error like pv: /mnt/ddev_config/.importdb3453168728/*.*sql: No such file or directory

EDIT Okay I've just this moment realized that a VM created with colima start --disk 100 --memory 6 --vm-type qemu --runtime docker --mount-type virtiofs reports that it's using 9p mount type. Investigating further

75th commented 1 year ago

Re: my EDIT above, I opened an issue at colima

abiosoft commented 1 year ago

@75th as mentioned in the issue, vz and virtiofs goes hand in hand. The test result above is most likely 9p and not virtiofs.

balajiv113 commented 1 year ago

@75th I believe the poor performance in vz is related to how persistent disk are attached in lima. I will update this in lima once https://github.com/Code-Hex/vz/pull/117 is merged.

Temporarily if you are interested you can do this workaround and then try importing.

colima ssh
sudo -i
echo 'write through' > /sys/class/block/vda/queue/write_cache

Check this for more Detailed Reference

rfay commented 1 year ago

@balajiv113 I confirm that that makes colima with vz BLAZINGLY fast on ddev import-db.

rfay commented 1 year ago

Here are my results of testing the various permutations, https://ddev.com/ddev-local/ddev-docker-desktop-and-colima-benchmarking-updated-dec-2022/

abiosoft commented 1 year ago

This https://github.com/drud/ddev/issues/4466#issuecomment-1361261185 can be handled in Colima directly as a workaround for now.

abiosoft commented 1 year ago

This #4466 (comment) can be handled in Colima directly as a workaround for now.

Now that this is included in v0.5.2, it would be nice to see the blog post updated.

rfay commented 1 year ago

Awesome, will test!

rfay commented 1 year ago

@abiosoft updated the blog, it did indeed solve lots of things, and Colima/VirtioFS is now the fastest non-mutagen option out there! https://ddev.com/ddev-local/ddev-docker-desktop-and-colima-benchmarking-updated-dec-2022/

Of course I know you already saw my report of SEGFAULTS in VirtioFS,