问题
I did a lot of search and no solution worked for me.
Firstly, I have two projects on the same server, one using CodeIgniter and the other using Laravel.
The one which uses Laravel occasionally loads very slow
This image shows empty page written with Laravel

And this image shows that user waits for about 33 sec.

I had a quick look for some websites that run Laravel. I noticed that this issue exists there too, you can try October CMS .
Finally this is what I did:
- Set
debug
tofalse
- Run
artisan optimize --force
- Set database to
127.0.0.1
notlocalhost
Any ideas? and please note this happens occasionally and randomly
回答1:
This is not an issue with Laravel, it is most likely an issue with how your server is configured. Most likely it could boil down to how you have Apache/Nginx configured, where and how you are loading your static assets and other variables.
By the sounds of it, you are using a stock version of Laravel and stock version of PHP, the only difference between the two being which PHP features one another supports and the structure of the applications themselves. In my personal benchmarks Laravel is undeniably faster than Codeigniter due to lazy loading. Have you tried running the same tests on a different server or even locally on your own machine?
来源:https://stackoverflow.com/questions/23673578/laravel4-response-very-slow-and-take-much-time-to-load