关于joomla数据库链接速度问题
最近刚用joomla做了一个网站,感觉joomla的反映速度总是比其他同类cms慢一些。
仔细观察发现,程序在建立数据库连接的时候使用了1秒左右的时间,网站首页整体加载才1.2秒左右,也就是说建立数据库连接占用了83%的时间,这种性能的丢失是很不好地。
我先将连接方式改用 mysql_connect 检查发现,连接速度还是没变化。
在找到\libraries\joomla\database\driver\mysql.php
修改87行附近的代码,该代码加上debug标记。global $_PROFILER;
// Mark beforeMysqlConnect in the profiler.
JDEBUG ? $_PROFILER-mark('beforeMysqlConnect') : null;
// Attempt to connect to the server.
if (!($this-connection = @ mysql_pconnect($this-options['host'], $this-o
仔细观察发现,程序在建立数据库连接的时候使用了1秒左右的时间,网站首页整体加载才1.2秒左右,也就是说建立数据库连接占用了83%的时间,这种性能的丢失是很不好地。
我先将连接方式改用 mysql_connect 检查发现,连接速度还是没变化。
在找到\libraries\joomla\database\driver\mysql.php
修改87行附近的代码,该代码加上debug标记。global $_PROFILER;
// Mark beforeMysqlConnect in the profiler.
JDEBUG ? $_PROFILER-mark('beforeMysqlConnect') : null;
// Attempt to connect to the server.
if (!($this-connection = @ mysql_pconnect($this-options['host'], $this-o
没有找到相关结果
已邀请:
2 个回复
刘备曹操 - 古今多少事,都付谈笑中
赞同来自:
跑堂小2 - 冇钱;冇房子;冇成就。要吃饭;要住宿;要消费
赞同来自:
另外joomla会先加载libraries下面的config.php文件读取配置,这不知道是不是沿用的以前的版本的逻辑,没看过