当前位置: 首页 > news >正文

wordpress评论开关网站上的产品五星怎样做优化

wordpress评论开关,网站上的产品五星怎样做优化,成都龙华小学网站建设,精选商城app下载前导  上次Redis MQ分布式改造完成之后#xff0c; 编排的容器稳定运行了一个多月#xff0c;昨天突然收到ETL端同事通知#xff0c;没有采集到解析日志了。赶紧进服务器看了一下#xff0c;用于数据接收的receiver容器挂掉了#xff0c; 尝试docker container start [c… 前导    上次Redis MQ分布式改造完成之后 编排的容器稳定运行了一个多月昨天突然收到ETL端同事通知没有采集到解析日志了。 赶紧进服务器看了一下用于数据接收的receiver容器挂掉了 尝试docker container start [containerid],  几分钟后该容器再次崩溃。 Redis连接超限  docker log [containerid]  查看容器日志 重点CSRedis.RedisException: ERR max number of clients reached 日志上显示连接Redis服务器的客户端数量超限头脑快速思考目前编排的某容器使用CSRedisCore 对于16个Redis DB实例化了16个客户端但Redis服务器也不至于这么不经折腾吧。赶紧进redis.io官网搜集相关资料。After the client is initialized, Redis checks if we are already at the limit of the number of clients that it is possible to handle simultaneously (this is configured using the maxclients configuration directive, see the next section of this document for further information).In case it cant accept the current client because the maximum number of clients was already accepted, Redis tries to send an error to the client in order to make it aware of this condition, and closes the connection immediately. The error message will be able to reach the client even if the connection is closed immediately by Redis because the new socket output buffer is usually big enough to contain the error, so the kernel will handle the transmission of the error. 大致意思是Redis服务器maxclients配置了客户端连接数 如果当前连接的客户端超限Redis会回发一个错误消息给客户端并迅速关闭客户端连接。立刻登录Redis服务器查看默认配置确认当前Redis服务器默认配置是10000。After the client is initialized, Redis checks if we are already at the limit of the number of clients that it is possible to handle simultaneously (this is configured using the maxclients configuration directive, see the next section of this document for further information).In case it cant accept the current client because the maximum number of clients was already accepted, Redis tries to send an error to the client in order to make it aware of this condition, and closes the connection immediately. The error message will be able to reach the client even if the connection is closed immediately by Redis because the new socket output buffer is usually big enough to contain the error, so the kernel will handle the transmission of the error. 左图表明通过Redis-Cli 登录进服务器立即就被踢下线。基本可认定redis客户端使用方式有问题。CSRedisCore使用方式 继续查看相关资料可在redis服务器上利用redis-cli命令info clients、client list仔细分析客户端连接。info clients 命令显示现场确实有10000的连接数client list命令显示连接如下官方对client list命令输出字段的解释addr: The client address, that is, the client IP and the remote port number it used to connect with the Redis server.fd: The client socket file descriptor number.name: The client name as set by CLIENT SETNAME.age: The number of seconds the connection existed for.idle: The number of seconds the connection is idle.flags: The kind of client (N means normal client, check the full list of flags).omem: The amount of memory used by the client for the output buffer.cmd: The last executed command.根据以上解释表明 Redis服务器收到很多ip172.16.1.3故障容器在网桥内的Ip 地址的客户端连接这些连接最后发出的是ping命令这是一个测试命令故障容器使用的Redis客户端是CSRedisCore该客户端只是单纯将 Msg 写入Redis list 数据结构CSRedisCore上相关github issue给了我一些启发。发现自己将CSRedisClient实例化代码写在 .netcore api Controller构造函数这样每次请求构造Controller时都 实例化一次Redis客户端最终Redis客户端不超限才怪。依赖注入三种模式 单例系统内单一实例一次性注入瞬态每次请求产生实例并注入自定义范围。有关dotnet apicontroller 以瞬态模式 注入请查阅链接。 赶紧将CSRedisCore实例化代码移到 startup.cs 并注册为单例。大胆求证info clients命令显示稳定在53个Redis连接。client list命令显示172.16.1.3故障容器建立了50个客户端连接编排的另一个容器webapp建立了2个连接redis-cli命令登录到服务器建立了1个连接。那么问题来了修改之后receiver容器为什么还稳定建立了50个redis连接进一步与CSRedisCore原作者沟通确定CSRedisCore有预热机制默认在连接池中预热了个连接。bingo故障和困惑全部排查清楚。总结经此一役在使用CSRedisCore客户端时 要深入理解① Stackexchange.Redis 使用的多路复用连接机制使用时很容易想到注册到单例CSRedisCore开源库采用连接池机制在高并发场景下强烈建议注册为单例 否则在生产使用中可能会误用在瞬态请求中实例化导致redis客户端几天之后被占满。② CSRedisCore会默认建立连接池预热50个连接 开发者心里要有数。额外的方法论 尽量不要从某度找答案要学会问问题并尝试从官方、stackoverflow 、github社区寻求解答你挖过的坑也许别人早就挖过并踏平过。原文链接https://www.cnblogs.com/JulianHuang/p/11541658.html.NET社区新闻深度好文欢迎访问公众号文章汇总 http://www.csharpkit.com
http://www.zqtcl.cn/news/830864/

相关文章:

  • 网站开发的软件支持哈尔滨最新消息
  • jsp淘宝客网站有限公司怎么注册
  • 香奈儿电子商务网站建设策划书怎样进行网络营销吸引顾客
  • 昆山网站建设费用我们公司想做网络推广
  • 网站建设一般要多少钱网站开发主要步骤
  • 商用图片的网站网络文化经营许可证查询
  • c 高性能网站开发弄一个公司网站需要多少钱
  • 建设部网站招标投标文件网页设计专业公司
  • 使用iis6搭建网站wordpress调用搜索功能
  • 装配式建筑网站生活家装饰
  • 怎样做软件网站建设百度网站认证官网
  • phpcms网站什么网站都能进的浏览器
  • 建设配资网站有要求吗网站建设不一定当地
  • 永兴网站开发智慧门店管理服务平台
  • 网站建设前的市场分析李炎辉网站建设教程
  • 乱起封神是那个网站开发的?广州市建设注册中心网站首页
  • 网站开发配置网络广告的投放技巧
  • wordpress 漫画网站安徽省建设厅八大员报名网站
  • 音乐网站排名建设部证书查询网站
  • 长沙建站挺找有为太极wordpress eshop 教程
  • 郑州平台类网站网站开发常见面试题
  • 城乡建设网站职业查询系统做网站设计的需要什么材料
  • ui做的好看的论坛网站加工制造网
  • 南庄网站开发厦门建设局网站城市建设
  • 常州网站建设效果重庆招聘网
  • 做视频网站需要多大的带宽公众号怎么开通直播功能
  • 信息化网站建设引言南宁 网站建设
  • 怎么做外贸网站的邮箱签名做网站页面怎么做
  • 做文库网站怎么赚钱吗百度网盘下载官网
  • 带后台的网站模板下载wordpress文章置顶插件