laravel4响应非常慢,需要很多时间加载 [英] laravel4 response very slow and take much time to load

查看:271
本文介绍了laravel4响应非常慢,需要很多时间加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了很多搜索,没有解决方案为我工作。



首先,我在同一个服务器上有两个项目,一个使用CodeIgniter,另一个使用Laravel。



使用Laravel 偶尔加载速度非常慢的程序。
此图像显示了用Laravel写的空页面



此图片显示用户等待约33秒。

有时,此时间来自接收



我快速浏览了一些运行Laravel的网站。我注意到此问题也存在,您可以试试10月CMS。



最后这是我做的:
$ b


  • 调整设为 false

  • 运行 artisan optimize --force

  • 将数据库设置为 127.0.0.1 localhost



请注意这发生偶尔随机

解决方案

Laravel的问题,它很可能是一个问题,如何配置您的服务器。很可能它可以归结为您如何配置Apache / Nginx,在哪里和如何加载您的静态资产和其他变量。



根据它的声音,正在使用Laravel的股票版本和PHP的股票版本,两者之间的唯一区别是彼此支持的PHP特性和应用程序本身的结构。在我的个人基准Laravel不可否认比Codeigniter由于延迟加载快。您是否尝试在不同的服务器上运行相同的测试,甚至在本地计算机上运行相同的测试?


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. 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

解决方案

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?

这篇关于laravel4响应非常慢,需要很多时间加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆