简体   繁体   中英

Symfony / Sylius site on Vagrant / Puphpet is slow. Same site not on a Virtualbox is not slow

We have one particular site that is Symfony and uses the e-commerce bundle Sylius.

Our developers are trying to use Vagrant so we can have similar dev environments. We use Puphpet to generate the Vagrant instance and share the config file.

If we are working on the site/repo natively or on a staging server, all runs fine. Pages load in around 2-3 seconds.

When we are using Vagrant / Virtualbox, it's 30-35 seconds per page load.

So far we've tried

  • Allocating up to 6GB to the box
  • Giving up to 4 processors to the box
  • Turning on NFS for file sync
  • Turning off all other programs on computers running Vagrant / Virtualbox (chat, other browsers, etc)

None of those things made an impact on page load time.

I can provide 2 things. One is the load trace from Symfony: https://nimbus.everhelper.me/client/notes/share/708707/mvw707mckzm2wq4rlkzc

Since there is so much code to the puphpet config, I put it in a pastebin here: http://pastebin.com/7ciVA5FL

What is OS on a host machine?

My guess would be that file system is slow. Try to run an app outside of shared folder on the guest machine. If it will be fast, then you'll spot a problem at least.

NFS on *nix or mac should be fast enough, are you sure you've succeed to turn it on?

I had this pain once, and finally started to use unison instead of native vagrant's file sharing system ( https://www.cis.upenn.edu/~bcpierce/unison/ )

Have your tried:

I think the first one is already included in Sylius, but not sure.

Also, dynamic image resize/crop may be reading/writing in the host file system and maybe there's a way to also change that (using symlinks or similar)?

vagrant-winnfsd对于让NFS在Windows上运行对我来说效果很好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM