Slow page loads
Created 7 years ago by gwerner

I'm only in local development at the moment, but pages are loading pretty slowly. This is a fresh install I've only just started taking a look and haven't developed anything at this point. The admin panel at the bottom show page load in 4-5 secs. Is this normal? Is there a setting that needs changed? This might be a nit pick, but during local development fast refresh is preferred. Any ideas?

gwerner  —  7 years ago Best Answer

Thanks again for the feedback. I did get this sorted out this morning. Homestead isn't using NFS by default. All I needed to do was add the type: nfs to my Homestead.yaml and now Pyro loads in under a second. It looks like NFS is off by default on Homestead because Windows doesn't support it.

folders:
- map: ~/Code/Template
to: /home/vagrant/Code/template
type: nfs
ryanthompson  —  7 years ago

I 100% agree! Fast refresh is paramount. Speed almost always comes down to the autoloader. Try dumping an optimized autoloader and I'm not a vagrant pro but if you're using that make sure the disk allocation is not shared. I'll point to some others here as I've not had many issues with speed myself to overcome.

daviesgeek  —  7 years ago

What operating system are you on? Are you on an SSD? Are you serving files from a VM (particularly VBox)? Where is the MYSQL server running? What version of PHP are you running?

edster  —  7 years ago

Hey @gwerner, can you give us more information on your enviroment?

OS/PHP version/any specialties (docker/vagrant).

Few things that i know have helped alot of people, if possible, use an SSD, pyro checks a shit ton of files and it helps alot, 2nd (prob the biggest thing you can do) is use PHP 7. It is CRAZY how much faster just using php7 can make it.

daviesgeek  —  7 years ago

@edster I'll add to that as well…opcache makes a HUGE difference.

william  —  7 years ago

I am on mac, using homestead. I also had 4-5s load time when logged in as admin. I didn't have time to investigate it a lot. So i changed to valet, and then it runs at a speed you can expect.

/w

gwerner  —  7 years ago

Hey all, thanks for the replies. First, I'm on a Mac and using the latest homestead I believe. So, vagrant, virtual box, PHP 7.0.8. It looks like Zend opcache is also running. I'm also using an SSD as well. I've not heard of valet, I'll check it out. Beyond that I wouldn't think there should be too much to setup? But, I could be wrong. I've done multiple installations of plain Laravel and not had a problem with speed.

ryanthompson  —  7 years ago

@gwerner make sure xDebug is disabled too that will kill things. While Pyro is considerably more than laravel it does seem some quirks exist in a few setups :-/

william  —  7 years ago

Here is a link to Valet: https://laravel.com/docs/5.3/valet

Since we both have this issue, i will try to find the time to look into it over the weekend. Hopefully i can figure out why it is so slow on homestead. However, Valet will probably be faster than Homestead anyway. So go get it😄

/W

gwerner  —  7 years ago Best Answer

Thanks again for the feedback. I did get this sorted out this morning. Homestead isn't using NFS by default. All I needed to do was add the type: nfs to my Homestead.yaml and now Pyro loads in under a second. It looks like NFS is off by default on Homestead because Windows doesn't support it.

folders:
- map: ~/Code/Template
to: /home/vagrant/Code/template
type: nfs
ryanthompson  —  7 years ago

Excellent! Ill have to remember that.. or better yet start using Homestead and become more knowledgable on the matter 🙍

Glad you got it sorted!

edster  —  7 years ago

Glad you figured it out, I was just about to post about this as one of the biggest homestead issues that gets resolved.

william  —  7 years ago

Confirmed using nfs fixed it on my machine as well.

ryanthompson  —  7 years ago

@gwerner if you don't mind - mark a "best answer" I think we'll be getting others looking for the same for a wee bit until I get to the real root of this issue.

gwerner  —  7 years ago

@ryanthompson Will do and honestly I only was turned on to NFS by a github issues from Aug. 2015 that you replied to with someone else having this issue. Or at least a similar issue.