请教个关于tinkphp下mysql查询缓慢问题

发布于 2021-11-28 23:16:45 字数 4068 浏览 779 评论 3

各位好,遇到一个问题。现在的项目是基于tinkphp上面二次开发的系统,目前发现系统经常出现访问时快时慢的情况,排查了一下数据库、还有web服务器使用率都不高。

但是排查日志的时候,发现在调用数据库的时候,经常出现dump情况。麻烦各位帮忙看下,到底是怎么回事。

[07-May-2017 17:00:18]  [pool www] pid 1195
script_filename = /usr/local/nginx/html/index.php
[0x00007fd033454a90] query() /usr/local/nginx/html/ThinkPHP/Library/Think/Db/Driver/Mysqli.class.php:88
[0x00007fd0334547d8] query() /usr/local/nginx/html/ThinkPHP/Library/Think/Db.class.php:773
[0x00007fd0334539a8] select() /usr/local/nginx/html/ThinkPHP/Library/Think/Model.class.php:618
[0x00007fd0334535d0] select() /usr/local/nginx/html/Application/Common/Api/ConfigApi.class.php:20
[0x00007fff42f22c90] lists() unknown:0
[0x00007fd033453290] call_user_func_array() /usr/local/nginx/html/Application/Common/Common/function.php:1054
[0x00007fd03344f360] api() /usr/local/nginx/html/ThinkPHP/Library/Think/Dispatcher.class.php:197
[0x00007fd03344eb08] dispatch() /usr/local/nginx/html/ThinkPHP/Library/Think/App.class.php:36
[0x00007fd03344e930] init() /usr/local/nginx/html/ThinkPHP/Library/Think/App.class.php:184
[0x00007fd03344d128] run() /usr/local/nginx/html/ThinkPHP/Library/Think/Think.class.php:121
[0x00007fd03344bae0] start() /usr/local/nginx/html/ThinkPHP/ThinkPHP.php:96
[0x00007fd03344b440] +++ dump failed

[07-May-2017 17:00:25]  [pool www] pid 1196
script_filename = /usr/local/nginx/html/index.php
[0x00007fd033454c28] query() /usr/local/nginx/html/ThinkPHP/Library/Think/Db/Driver/Mysqli.class.php:88
[0x00007fd033454798] query() /usr/local/nginx/html/ThinkPHP/Library/Think/Db/Driver/Mysqli.class.php:209
[0x00007fd033453d88] getFields() /usr/local/nginx/html/ThinkPHP/Library/Think/Model.class.php:138
[0x00007fd033453a10] flush() /usr/local/nginx/html/ThinkPHP/Library/Think/Model.class.php:125
[0x00007fd033453498] _checkTableInfo() /usr/local/nginx/html/ThinkPHP/Library/Think/Model.class.php:1510
[0x00007fd033453018] db() /usr/local/nginx/html/ThinkPHP/Library/Think/Model.class.php:99
[0x00007fd033452888] __construct() /usr/local/nginx/html/ThinkPHP/Common/functions.php:625
[0x00007fd033451a38] D() /usr/local/nginx/html/Application/Mob/Model/ActivityModel.class.php:430
[0x00007fd033450c20] get_ActivityHallList() /usr/local/nginx/html/Application/Mob/Controller/EnterpriseController.class.php:1285
[0x00007fff42f22c50] getMore() unknown:0
[0x00007fd03344f2f8] invoke() /usr/local/nginx/html/ThinkPHP/Library/Think/App.class.php:155
[0x00007fd03344f120] exec() /usr/local/nginx/html/ThinkPHP/Library/Think/App.class.php:193
[0x00007fd03344d918] run() /usr/local/nginx/html/ThinkPHP/Library/Think/Think.class.php:121
[0x00007fd03344c2d0] start() /usr/local/nginx/html/ThinkPHP/ThinkPHP.php:96
[0x00007fd03344bc30] +++ dump failed

[07-May-2017 17:00:25]  [pool www] pid 1217
script_filename = /usr/local/nginx/html/index.php
[0x00007fd033457c70] is_file() /usr/local/nginx/html/ThinkPHP/Library/Think/Cache/Driver/File.class.php:79
[0x00007fd033457690] get() /usr/local/nginx/html/ThinkPHP/Common/functions.php:1245
[0x00007fd033457590] S() /usr/local/nginx/html/Application/Common/Model/UserModel.class.php:147
[0x00007fd033457228] read_query_user_cache() /usr/local/nginx/html/Application/Common/Model/UserModel.class.php:183
[0x00007fd033455ae0] getCachedFields() /usr/local/nginx/html/Application/Common/Model/UserModel.class.php:37
[0x00007fd033455908] query_user() /usr/local/nginx/html/Application/Common/Common/query_user.php:18
[0x00007fd033455230] query_user() /usr/local/nginx/html/Application/People/Widget/HomeBlockWidget.class.php:34
[0x00007fd0334550a8] assignUser() /usr/local/nginx/html/Application/People/Widget/HomeBlockWidget.class.php:18
[0x00007fff42f22360] render() unknown:0
[0x00007fd033454dc8] call_user_func_array() /usr/local/nginx/html/ThinkPHP/Common/functions.php:771
[0x00007fd033454cd8] R() /usr/local/nginx/html/ThinkPHP/Common/functions.php:1176
[0x00007fd0334524e0] W() /usr/local/nginx/html/Runtime/Cache/Home/769e70f2e46f34ceb60619bbda5e4691.php:337
[0x00007fd033452390] +++ dump failed

 

 

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一笔一画续写前缘 2021-12-05 00:17:57

我就是通过开启slow日志看到这个情况的啊。

酒几许 2021-12-04 11:03:36

这些日志看不出来什么问题的。既然时快时慢,那就将php和mysql都启动slow模式分别启用来跟进查看日志看看。

情痴 2021-12-03 22:00:56

排查ThinkPHP本身的日志信息

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文