TP连接数据库慢执行

浏览:905 发布日期:2017/12/06 分类:求助交流 关键字: tp数据库慢连接
虚拟机A和B部署同一个TP项目,项目连接的是远程阿里云的db。
环境A访问正常,环境B访问时慢时快,通过打印php-fpm的慢日志
请问是哪些原因导致?


图上传不了,直接复制:
[06-Dec-2017 14:07:54] [pool www] pid 8583
script_filename = /web/index.php
[0x00007fce932ffc38] __construct() /web/ThinkPHP/Library/Think/Db/Driver.class.php:103
[0x00007fce932ff698] connect() /web/ThinkPHP/Library/Think/Db/Driver.class.php:1075
[0x00007fce932ff410] initConnect() /web/ThinkPHP/Library/Think/Db/Driver/Mysql.class.php:47
[0x00007fce932fec08] getFields() /web/ThinkPHP/Library/Think/Model.class.php:134
[0x00007fce932fe1f8] flush() /web/ThinkPHP/Library/Think/Model.class.php:122
[0x00007fce932fde48] _checkTableInfo() /web/ThinkPHP/Library/Think/Model.class.php:1454
[0x00007fce932fd8b0] db() /web/ThinkPHP/Library/Think/Model.class.php:97
[0x00007fce932fd3e8] __construct() /web/ThinkPHP/Common/functions.php:588
[0x00007fce932fcc50] D() /web/Application/Home/Model/UserNeinfoModel.class.php:11
[0x00007fce932fca28] __construct() /web/ThinkPHP/Common/functions.php:588
[0x00007fce932fc290] D() /web/Application/Home/Controller/IndexController.class.php:645
[0x00007fff39126b50] getMemberList() unknown:0
[0x00007fce932fbe90] invoke() /web/ThinkPHP/Library/Think/App.class.php:173
[0x00007fce932fafb0] invokeAction() /web/ThinkPHP/Library/Think/App.class.php:110
[0x00007fce932fa4c0] exec() /web/ThinkPHP/Library/Think/App.class.php:204
[0x00007fce932fa220] run() /web/ThinkPHP/Library/Think/Think.class.php:120
[0x00007fce932f8a60] start() /web/ThinkPHP/ThinkPHP.php:97
[0x00007fce932f7378] +++ dump failed

追踪下来,是这句话导致:
$this->linkID[$linkNum] = new PDO( $config['dsn'], $config['username'], $config['password'],$this->options);

tp框架用pdo连接远程阿里云db,环境A是正常,环境B又是不正常
最佳答案
评论( 相关
后面还有条评论,点击查看>>