Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel4 response very slow and take much time to load

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
enter image description here

And this image shows that user waits for about 33 sec. enter image description here Sometimes, this time comes from Receiving

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 to false
  • Run artisan optimize --force
  • Set database to 127.0.0.1 not localhost

Any ideas? and please note this happens occasionally and randomly

like image 273
Samy Massoud Avatar asked Nov 10 '22 08:11

Samy Massoud


1 Answers

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?

like image 145
Dwayne Charrington Avatar answered Nov 15 '22 08:11

Dwayne Charrington