问题:web项目页面打开奇慢(从机械硬盘换到ssd,好一点但还是一坨屎)。
原因:In some cases the default shared folder implementations (such as VirtualBox shared folders) have high performance penalties.
步骤:
1、先排除web相关的影响。如php.ini的xdebug是否有开启,nginx配置中sendfile是否为off。
Make sure you edit /etc/nginx/nginx.conf and set "sendfile" to off if using NFS or you will run into weird caching issues.
2、更改Vagrantfile配置。
config.vm.synced_folder ".", "/vagrant", type: "nfs"
3、安装 vagrant-winnfsd扩展。
vagrant plugin install vagrant-winnfsd
ps:第一次安装失败例如看到
再来一次,也许会有彩蛋 - - (佩服外国友人的描述 @gregfenton:Maybe a hiccup in the HTTP server or your network?)
4、vagrant reload
看到类似上图的,ok了,再刷新下页面感受一下吧~~
参考:
http://docs.vagrantup.com/v2/synced-folders/nfs.html
https://laracasts.com/discuss/channels/general-discussion/for-those-who-find-homesteadvagrantvirtualbox-slow-on-windows?page=0