简体   繁体   English

服务器响应延迟,apache2 codeigniter

[英]Delay in server response, apache2 codeigniter

Noticing a long delay in server processing time.注意到服务器处理时间的长时间延迟。 The application environment is: Apache2应用环境为:Apache2
Ubuntu 10.04 PHP 5.3 Codeigniter 2.1 Ubuntu 10.04 PHP 5.3 Codeigniter 2.1
first call after a time causes a significant delay一段时间后的第一次调用会导致明显的延迟
codeigniter profiler is enabled and gives this feedback codeigniter 分析器已启用并提供此反馈
Loading Time: Base Classes 2.7587加载时间:基类 2.7587
Controller Execution Time ( Home / Index ) 7.2188 Controller 执行时间(首页/索引)7.2188
Total Execution Time 9.9777总执行时间 9.9777
There are only 2 database active record queries both taking less than a 10th of a second.只有 2 个数据库活动记录查询都花费不到十分之一秒。
I am not using any kind of cache.我没有使用任何类型的缓存。
However the same page on refreshing yields this by the codeigniter profiler然而,刷新的同一页面由 codeigniter 分析器产生
Loading Time: Base Classes 0.0074加载时间:基类 0.0074
Controller Execution Time ( Home / Index ) 0.1471 Controller 执行时间(首页/索引)0.1471
Total Execution Time 0.1545总执行时间 0.1545

From +9 seconds to almost tenth of a second.从 +9 秒到几乎十分之一秒。
This time there are 2 more database queries (codeigniter session fetch and updtate)这次还有2个数据库查询(codeigniter session fetch and updtate)
Is there something i can modify to to reduce the time when a new session is started?有什么我可以修改以减少启动新 session 的时间吗?

what kind of database driver do you use?你使用什么样的数据库驱动程序? are they differs with the other page?它们与其他页面不同吗? cause i have faced this problem too.因为我也遇到过这个问题。 i use mysql database server version 5.XX i use CI 2.0.3我使用 mysql 数据库服务器版本 5.XX 我使用 CI 2.0.3

this is the report from the profiler这是分析器的报告

using driver mysql使用驱动 mysql


Loading Time: Base Classes 0.4485 Controller Execution Time ( Single Import / Get Dpt Count By Region ) 0.1042 Total Execution Time 0.5531加载时间:基类 0.4485 Controller 执行时间(单次导入/按区域获取 Dpt 计数)0.1042 总执行时间 0.5531

using driver mysqli使用驱动 mysqli


Loading Time: Base Classes 1.4436 Controller Execution Time ( Single Import / Get Dpt Count By Region ) 1.1049 Total Execution Time 2.5488加载时间:基类 1.4436 Controller 执行时间(单次导入/按区域获取 Dpt 计数)1.1049 总执行时间 2.5488

so i suggest you to only use mysql driver, i still don't any clue(don't have time to debug:D) if there is a problem with CI when try to load mysqli driver cause the load base classes significant than the other one(mysql).所以我建议你只使用 mysql 驱动程序,如果在尝试加载 mysqli 驱动程序时 CI 出现问题,我仍然没有任何线索(没有时间调试:D)导致负载基类比其他重要一个(mysql)。 i hope this can help you.我希望这可以帮助你。 :) :)

CodeIgniter in opposite to Zend is already lighted. Zend 对面的 CodeIgniter 已经点亮。 Try comment unused libraries.尝试评论未使用的库。

There is no doubt it's something wrong with your server installation.毫无疑问,您的服务器安装有问题。

I use Ubuntu 11.04 with the last XAMPP and it works great, try reinstalling your server.我使用 Ubuntu 11.04 和最后一个 XAMPP 效果很好,请尝试重新安装您的服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM