I have a vagrant server based off Laravel Homestead for testing my Laravel sites locally for the most part it runs great. However, recently, I have been having problems where it will just halt for anything from a few minutes (typical) to hours (rare). This happens every 15 minutes or so. To the point where if I'm typing in the ssh connection it will just stop. Then when I check back a few minutes later, what I had been typing is now there. This isn't just SSH and pages stop loading, and vagrant commands including rsync and even halt fail.
This is vanilla Homestead, except for I changed the mapping to be via rsync (manual, I run the rsync command whenever I want to update the server). The reason for this was because I was getting 30second or so load times for webpages and after research and trying rsync this helped massively for this. Also, I have (since the problem) tried giving it access to all 4 cpus. I am running this on a macbook air 2013 if this is important. It has been running fine for the past 2 months. The vagrant server is running with 2048MB of memory and I have 15GB of disk space free.
This is a very frustrating problem as it slows down development massively.
edit: This seems to happen most frequently (but not exclusively) when using the mysql command line over ssh
Increasing allocated CPU cores and RAM in Vagrant As a start, you should always increase the allocated CPU cores and RAM in your Vagrantfile. This should be based on the resources available on your team's computers, and the resources required to run your application.
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. Vagrant provides a simple, elegant way to manage and provision Virtual Machines.
I had the same issue on windows and this fixed it:
install this vagrant plugin:
vagrant plugin install vagrant-winnfsd
then add this to your homestead.yaml
:
type: nfs
yaml file should look like this:
folders:
- map: C:\my-www
to: /home/vagrant/my-www
type: nfs
when all is done destroy your vagrant and do vagrant up
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With