0

Versions:

  • Lumen: 5.2
  • Vagrant: 1.8.1
  • Homestead: latest

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.

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

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;
    }

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?

Feek
  • 640
  • 6
  • 20

1 Answers1

1

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.

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

on the guest side you should do this https://wiki.ubuntu.com/MountWindowsSharesPermanently

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.

good luck.

jelmer
  • 2,405
  • 14
  • 27
Cristian Sepulveda
  • 1,572
  • 1
  • 18
  • 25