对宅基地的反应非常缓慢 [英] Very Slow Responses On Homestead

查看:71
本文介绍了对宅基地的反应非常缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

版本:

  • 流明:5.2
  • 无业游民:1.8.1
  • 宅基地:最新

我刚刚安装了Homestead,并试图将其用于开发Lumen应用程序.流明应用程序在MAMP上非常快(如预期的那样),但是在Homestead上却非常慢.我预计使用VM时性能会下降,但我遇到的性能下降实际上使Homestead无法使用.

I have just installed Homestead and am attempting to use it for developing a Lumen application. The Lumen app is very fast on MAMP (as expected), however is extremely slow on Homestead. While I expect a performance drop when using a VM, the performance drop I am experiencing is essentially rendering Homestead unusable.

我在OS X Yosemite上,具有16GB的RAM和8个逻辑内核.我也在使用VirtualBox运行我的VM.

I am on OS X Yosemite and have 16GB of RAM and 8 logical cores. I am also using VirtualBox to run my VM.

Homestead.yaml

---
ip: "192.168.10.10"
memory: 4096
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/repos
      to: /home/vagrant/Code
      type: nfs

sites:
    - map: my-site.app
      to: /home/vagrant/Code/my-site/public

databases:
    - homestead

在我的Nginx配置中:

Inside my nginx config:

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index /index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

虽然通过PHPUnit运行我的测试套件非常快(既可以在Homestead内部运行,也可以从本地文件系统运行),但浏览器中的响应却非常缓慢.例如,返回 hello world 的简单路线需要5到10秒钟来做出响应.

While running my test suite via PHPUnit is lightning fast (running from both within Homestead and from my local file system), responses in the browser are painfully slow. For example, a simple route returning hello world takes 5 - 10 seconds to respond.

我该怎么做才能增加响应时间?我还有其他可以优化的设置吗?

What can I do to increase the response time? Are there any other settings that I can optimize?

推荐答案

在我的Windows中,这是因为virtualbox使用VBOXSF作为文件系统将文件夹从主机装载到来宾,我不知道为什么,但是速度很慢.

In my case in windows is because virtualbox uses VBOXSF as a file system to mount folders from host to guest, I don't know why but it is slow.

如果使用CIFS挂载该文件夹,则其运行速度会更快.

If you mount the folder using CIFS it should runs a lot faster.

在访客端,您应该 https://wiki.ubuntu.com/MountWindowsSharesPermanently

我不使用mac,所以我不确定如何在主机端进行操作,但是我想您只需要使用SMB将文件夹共享到网络即可.

I don't use mac so I'm not sure how to do it on the HOST side, but I guess that you only need to Share the folder to the network using SMB.

祝你好运.

这篇关于对宅基地的反应非常缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆