Open stevenscl opened 2 years ago
Dockerfile
FROM phpswoole/swoole:4.8-php7.4-alpine RUN set -ex \ && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ && apk update \ && apk add --no-cache --virtual .build-deps ca-certificates curl tar xz libressl libstdc++ openssl openssl-dev tzdata pcre autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev zlib-dev libpng-dev freetype-dev libjpeg-turbo-dev icu-dev libzip-dev mosquitto-dev \ && pecl update-channels \ && pecl install redis-stable \ && pecl install mongodb-stable \ && pecl install Mosquitto-alpha \ && docker-php-ext-enable redis mongodb mosquitto \ && docker-php-ext-install pdo_mysql bcmath gd sysvshm sysvmsg sysvsem zip intl
数据库连接池配置
测试发现,minActive = 5,则前面连续5次请求均失败,第6次恢复正常
这个问题已经很久了官方都没有解决,只能自己在定时器上写个查询,不停的给DB发查询请求来保活;我现在改了连接池的底层实现,但偶尔还会来一个上面那样的请求错误。 这样的更新维护效率swoft终究是要被淘汰的。
Describe the bug 数据库连接池popByChannel() Send of 5 bytes failed with errno=110 Operation timed out,导致请求失败
Expected behavior 应用启动一段时间过后,通常12小时以上,当再次发起请求,会出现如上报错
Screenshots
Details