-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Default mount type and slow VM #1428
Comments
Interesting! Here's an older article by the Vagrant creator: https://mitchellh.com/writing/comparing-filesystem-performance-in-virtual-machines I found https://github.com/winnfsd/vagrant-winnfsd/wiki/Benchmarking-winnfsd-vs-VirtualBox-Shared-Folders and winnfsd/vagrant-winnfsd#46 which has some benchmarks and some good discussion on how to benchmark different types of FS operations. Both seem to recommend NFS overall, but more specifically when reads are more important which is true for running a WordPress site for example (in normal situations). But for operations like running Maybe this is different on a Linux host though? It would be interesting to trace how many reads + writes are involved in a page load. |
Thank you for the resources. I will do more in-depth testing when I get the time. |
I did more testing, using the fio tool this time. I followed the recommended methodology detailed in this post as a base. I'm not at all an expert in filesystems, and I won't pretend these tests have any scientific value. But I still think the results are interesting and could open the discussion, and maybe someone more knowledgeable could participate. Host setup:Samsung SSD 970 EVO Plus 1TB Guest setup:vagrant_cpus: 4 The resultsRandom write speed (MiB/s)
Random read speed (MiB/s)
We can see that virtualbox mount type outperforms (by far) NFS, for both reading & writing. |
Wow that's huge. I can't test this on macOS unfortunately since I'm using Parallels for ARM. |
@LucasDemea I'm hesitant to make this change the default for all Linux users without some more data points from other users. But in the meantime, would you be interested in adding a section to our Vagrant docs about mount types specifically about Linux + VB? |
I agree that we need some feedback from other users before making the change. |
Terms
Description
What's wrong?
On a linux host (ubuntu 22.04), my VMs have really bad performance. The TTFB is around 5-6 sec, and navigating the back-end is a pain, often having to wait 10-15 secs for a page to load.
I also noticed some very long durations, sometimes leading to timeouts when doing operation such as
rm -rf vendor
, orcomposer install
inside the VM. The same operations are at least 10x faster when I run them on the host.What have you tried?
I found that the R/W speeds are bad inside the NFS mounted folders, so I tried the other protocols, by changing the
vagrant_mount_type:
setting invagrant.default.yml
tovirtualbox
.I compared the writing speeds with
dd if=/dev/zero of=./test bs=1M count=1000
inside one of the shared folders, and found that virtualbox protocol had much better results than NFS:The TTFB is also reduced, and navigating my sites is much faster.
What insights have you gained?
In my case, and possibly on other Linux hosts, the virtualbox shared folders protocol is much faster than NFS.
Suggestions
We first need more testing from the community, but
virtualbox
protocol could be suggested as the default trellis protocol.Steps To Reproduce
Switch the
vagrant_mount_type
setting fromnfs
tovirtualbox
and runvagrant reload
.Expected Behavior
NFS should be the fastest protocol
Actual Behavior
virtualbox is faster than NFS
Relevant Log Output
No response
Versions
ubuntu 22.04, trellis 1.9.1, vagrant 2.3.0, virtualbox 6.1.38
The text was updated successfully, but these errors were encountered: