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?