In the vagrant environment, the symfony program is slow. Recently, a symfony program was written. in the beginning, a simple web server was started to access the program through the console server: run command on Mac, however, the php provided by Mac itself does not have the memcached extension. Therefore, this program is put into vagrant. However, it is found that the access speed is very slow and it takes about 10 seconds to create an extremely simple page, so I searched and found that someone encountered the same problem.
Slow symfony program speed solution in vagrant environment
Several schemes listed in this article: http://leo108.com/pid-2196.asp
- Use vagrantv1.2. (this is not suitable for visual testing. more than 1.7 is available now)
- Mount a Directory using NFS
- The Vbox Guest Additions version in the vagrant virtual machine is the same as the virtual box version (my current environment is the same)
- Use opcache extension (apc has been installed in my current Environment)
- Disable xdebug and xphrof extensions (my current environment is closed)
In this case, you can only try the NFS mode. according to the configuration in the vagrant document, OS X comes with nfsd, saving the trouble of installation. you only need to modify the vagrantfile.
Symfony
Add two lines to vagrantfile:
Http://leo108.com/pid-2196.asp
Config. vm. network: private_network, type: dhcpconfig. vm. synced_folder ".", "/vagrant", type: "nfs"
Restart the vagrant virtual machine vagrant reload.