作者:merlion-p | 来源:互联网 | 2023-08-10 20:42
1.问题描述使用swoole作为服务端对接一个考勤机硬件,使用单进程,从mysql数据库里面读取用户数据,当一次性读取的用户数量大于3000的时候读取就会报错,此时内存占用到10M左右,
1.问题描述
使用swoole作为服务端对接一个考勤机硬件,使用单进程,从mysql数据库里面读取用户数据,当一次性读取的用户数量大于3000的时候读取就会报错,此时内存占用到10M左右,用户数据为基本信息,无长数据字段(name,userid,face_img(人脸地址)),请问下设置那个参数可以扩大这个限制?
2.问题出现的环境背景及自己尝试过哪些方法
swoole 版本: 4.4.6
thinkphp版本: thinkphp5.1.38 LTS
mysql版本 5.7
打印输出定位问题位置,
在onWorkerStart中 设置内存大小为128M ini_set('memory_limit','128M');
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
$user = Main::getRecord('db_device', 't_face_device_user', 'userid,name,privilege,face_img,list_id', [['device_no', '=', $device['device_no']]], 5000);
你期待的结果是什么?实际看到的错误信息又是什么?
2019-09-24 16:25:29 1 .memory_get_usage:4324456,
2019-09-24 16:25:29 2 .memory_get_usage:5038776,
2019-09-24 16:25:29 getSynUserInfo 1 .memory_get_usage:5103880,
2019-09-24 16:25:29 getSynUserInfo 2 .memory_get_usage:5171048,
2019-09-24 16:25:29 getSynUserInfo unset begin .memory_get_usage:8699784,
2019-09-24 16:25:29 getSynUserInfo unset last .memory_get_usage:8692056,
2019-09-24 16:25:29 getSynUserInfo stuid .memory_get_usage:10867024,
2019-09-24 16:25:29 getSynUserInfo unset stuid .memory_get_usage:8425760,
2019-09-24 16:25:29 getSynUserInfo unset begin 2:8989280,
2019-09-24 16:25:29 getSynUserInfo unset last 2:8693936,
[2019-09-24 16:25:29 $24616.0] WARNING swManager_check_exit_status: worker#0[pid=24618] abnormal exit, status=0, signal=11
A bug occurred in Swoole-v4.4.6, please report it.
The Swoole developers probably don't know about it,
and unless you report it, chances are it won't be fixed.
You can read How to report a bug doc before submitting any bug reports:
https://github.com/swoole/swo...
Please do not send bug reports in the mailing list or personal letters.
The issue page is also suitable to submit feature requests.