The :nfs => true Option for synced_folder in Vagrant in OSX
I've been working with using Vagrant on my test Zend Framework 2 project and I was having horrible performance problems that caused my very basic site to take more than three seconds to generate. I did some testing and the same site took a hundredth of the time if I ran it using MAMP. It turns out that VirtualBox's shared folder feature has some performance problems in OSX when there are a lot of files in the directory. Their solution is to switch over to using NFS.
This changes this line:
config.vm.synced_folder "../", "/var/www", id: "vagrant-root"
to:
config.vm.synced_folder "../", "/var/www", id: "vagrant-root", :nfs => true
After I changed this the performance got much better. It didn't match the same page load times as MAMP but it was actually a speed that I can work with. :-)
This isn't supposed to be a problem on Windows but I haven't been able to test this.
Scott Keck-Warren
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around the house with his loving partner.
Top Posts
- Working With Soft Deletes in Laravel (By Example)
- Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
- Upgrading to Laravel 8.x
- Get The Count of the Number of Users in an AD Group
- Multiple Vagrant VMs in One Vagrantfile
- Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
- Changing the Directory Vagrant Stores the VMs In
- Accepting Android SDK Licenses From The OSX Command Line
- Fixing the 'Target class [config] does not exist' Error
- Using Rectangle to Manage MacOS Windows