解决vagrant上使用Homestead很慢(响应速度10s+)

说明:

  使用vagrant和Homestead 在vBox上面跑laravel, 响应速度非常缓慢(大概在10+s),

  尝试过增加虚拟机配置, 但是没有任何效果, 经验证也不是数据库的原因 .

 

  通过网上查询了解到, 是因为VirtualBox的IO引起的: http://mitchellh.com/comparing-filesystem-performance-in-virtual-machines

 

解决方法1:

  在Homestead.yaml下添加type:nfs, 注意空格, map对应windows下面的物理路径

技术分享图片

解决方法2:
  如果上诉方法, 还是不能增加响应速度(我的就是), 则尝试以下方法
  安装一个vagrant 插件


  

$ vagrant plugin install vagrant-winnfsd


  然后修改 Homestead/scripts/homestead.rb 的代码, 循环部分替换成如下:

技术分享图片

 

重启vagrant 之后, 响应速度已经将至 200 ms


----------参考资料
https://laracasts.com/discuss/channels/general-discussion/for-those-who-find-homesteadvagrantvirtualbox-slow-on-windows?page=1
http://mitchellh.com/comparing-filesystem-performance-in-virtual-machines

文章来自:http://www.cnblogs.com/Skrillex/p/8087141.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3