Symfony program slow solution in vagrant environment

Source: Internet
Author: User
Recently wrote a symfony program, the first is directly under the Mac through the console Server:run command to start a simple Web server to access, but the Mac itself comes with PHP does not memcached extension, so put this program into the vagrant , but found that the speed of the visit is very slow, a very simple page also need to consume about 10 seconds, so search for a bit, found before someone encountered the same problem.

Symfony program slow solution in vagrant environment

Several scenarios are listed in this article: http://leo108.com/pid-2196.asp

  1. Use vagrant1.2 version (visually inappropriate, now all 1.7+)
  2. mount a directory using NFS
  3. The VBox Guest Additions version in the Vagrant virtual machine is consistent with the virtual box version (my current environment is consistent)
  4. Using the Opcache extension (APC is already installed in my current environment)
  5. Turn off Xdebug and xphrof extensions (my current environment is off)

Look at this situation, only try the NFS mode, according to Vagrant's document configuration, fortunately OS X comes with NFSD, save the installation of trouble, only need to modify vagrantfile.

Symfony

Add two rows to the Vagrantfile:

Http://leo108.com/pid-2196.asp

Config.vm.network:p rivate_network, type::d hcpconfig.vm.synced_folder ".", "/vagrant", type: "NFS"

Then restart the vagrant virtual machine vagrant Reload

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.