解决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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM