Comments (3)
你测试一下就能知道了,上面你提到的两种方式是传统方式,是fpm/apache这种方式由fpm/apache帮php实现的,而swooleHttpServer则是一个常驻执行的CLI程序,也就是说,任何client连接如果你不主动去关闭,都是长连接。
from mix.
@onanying 您好,redis连接有些疑问:
框架里我看了是根据抛异常重新连接,那么问题如下:
1、 连接超时的情况,会等待几秒钟才抛异常,如果这时候刚好有大量访问,会引发很大的问题;
2、异常里检测用的字符串好像并不全,例如read error on connection
这种就没有。
3、ping()
是否也可以加入到检测里面:每次获取redis对象时,除了判断是否为null,使用ping命令看看返回值是否是+PONG
,不是的话也重连下。
from mix.
@52fhy
第一种情况,redis已经出现问题,在任何框架搭建的系统中,都会引发很大的问题,
第二种情况,所以需要大家一起来完善,参与到开源当中来
第三种情况,当连接被数据库主动断开时,ping是调用不了的,直接会报错,而且那种实现方式并不通用,连接保持我做过多种尝试,现在这种才是最简单实用的,与TP5一至。
from mix.
Related Issues (20)
- Redis-subscribe 支持 prefix 否? HOT 1
- 没有对mysql保留关键字做反引号处理 HOT 1
- 2.2版本 UDP服务器会重复执行处理接收到的数据 HOT 2
- 官网无法访问 HOT 2
- 数据量较多时,json_decode可能会失败 HOT 7
- PDO执行使用问号占位符的原生SQL报错 HOT 2
- 建议项目遵从语义化版本来维护版本号 HOT 1
- PHP用ip curl post请求 会卡1秒 HOT 5
- 新版本性能严重下降 HOT 6
- table方法传入表名order报错 HOT 1
- 验证器场景设置optional未生效 HOT 3
- Coroutine中同时使用Channel和Database pool导致出错 HOT 5
- mix-skeleton使用context()->get('guzzle') 报错 HOT 1
- php8RC3-swoole4.5.6 运行出错 HOT 1
- or and 查找抛出异常 HOT 1
- Upgrade to Zipkin 2.0 HOT 1
- log组件报错 HOT 1
- 推送模式卡死 HOT 1
- 如何正确的提交 PR
- V3 启动事务后 lastInsertId 值不正确 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mix.