-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvements #2
Comments
Yep, it would be great to speed it up. I think there are a few things we might do. From what I've gathered, a major source of slowness for Vagrant is accessing the shared folder. Newer versions of Vagrant let you use rsync to sync the folders, rather than trying to share between the filesystem and the vagrant machine, which is meant to be more efficient (though at the cost of some increased complexity). Might be worth a try. Another thing that might be worth a shot would be to install APC for PHP, which caches frequently-accessed php scripts in memory, which might help if the filesystem accesses are the major source of slowness. |
Also, in the short term, might be worth setting |
@nickautomatic Actually even on Windows NFS will work, with help from this plugin: https://github.com/winnfsd/vagrant-winnfsd Happy coding! |
@balazscsaba2006 Thanks for that - looks interesting! Have you tried it with Vagrant on Windows at all? If so, did you find it makes a noticeable difference to performance? |
Yes, we are using it for almost a year now on the current project. The performance boost is more visible with heavier systems, eg. based on Symfony, and the speedup is a couple 100%s. I really recommend it for Windows users. |
Ah, that sounds really promising! I'll definitely give this a try when I have a moment. Thanks again for the suggestion. |
Another possible performance improvement (jotting here while it's fresh in my mind) - Twig has a PHP extension that improves performance of compiling Twig templates. Adding that to the Vagrant box might give another speed boost. |
Exactly, this one |
Ah, interesting - thanks again @balazscsaba2006. Good to know it makes a noticeable difference! Now I just need to find some time to get it set up... |
@nickautomatic This is the best part, I've installed it on 4 servers in 10 minutes, so it is just a plug and play really. |
@balazscsaba2006 Excellent, that sounds promising. I still have to write a Puppet script to get it to install in Crafty Vagrant, but sounds like it should be easy enough in that case. |
I've just seen that Ubuntu 16.04 uses PHP 7 as its default PHP version. Since that's meant to have major performance improvements over PHP 5, I'd suggest we bump Crafty up to Ubuntu 16.04 in the near future (it's due to be released later this week). |
An Ubuntu 16.04 / PHP 7 / Apache 2.4 / MySQL 5.7 environment is now available on a feature branch (feature/php7.0) This should be significantly more performant, but would be good to test this a bit before merging it into master. If anyone tries and has any feedback (eg. Did it improve performance? Did you run into any problems?) please do post it here! |
After inserting
The whole line in the config now looks like this:
Why would this happen? The path hasn't changed and the folder is where it was before. It seems one of the 2 folders haven't mounted. |
@certainlyakey It turns out that switching to NFS changes the way permissions are handled, which I suspect is what's causing the problem you're experiencing here. I only suggested it because I thought it might be a "quick win", improving performance a bit on Unix-like host OSes without causing problems on Windows. But since it introduces problems of its own I don't think it's worthwhile (for us, anyway - Crafty Vagrant is intended to work on OSX, Linux, or Windows). Switching to PHP7 + Apache 2.4 - which you can try on the php7.0 feature branch - seemed like a better bet, since it provides significant performance improvements regardless of host OS. In future we might revisit this, but we'd probably more likely go with rsync than NFS for Vagrant's synced folders I think (since that potentially works on all host OSes). If you do get anywhere with NFS, do let us know (I'd be interested to see what you did to get it working), but for the above reasons there are no plans to switch to NFS with Crafty Vagrant, for the moment, anyway. If you'd like better performance, do try the feature/php7.0 branch (which we're still testing) and let us know how you get on. |
Thanks for your reply! I'm already on php7 - even though i installed it myself to a machine based on UPDATE: Actually now it's closer to 60-70%, so far better than before. If I'll try again to get somewhere with NFS, I'll give some instructions here. |
Any update on the possibility of NFS compatibility? |
@j-greig My previous comment still holds I'm afraid: we have no plans to switch to NFS. Please do feel free to send a pull request though if you (or anyone else) do manage to get it working! |
I think it'd be great if we can spend some time looking into the speed of crafty. It feels like a real drag sometimes.
I understand that Craft in dev mode is always going to be bit a bit slower but I wonder if there's anything we can do to speed it up, possibly on the Vagrant box?
The text was updated successfully, but these errors were encountered: