3

【故障公告】取代 memcached 的 redis 出现问题造成网站故障

 1 year ago
source link: https://www.cnblogs.com/cmt/p/16405164.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【故障公告】取代 memcached 的 redis 出现问题造成网站故障

6月19日开始,我们将博客站点的缓存服务器从 memcached 换成了 redis,稳定运行了3天,今天上午访问高峰突然出现问题,在 11:00-12:30 期间影响了网站的正常访问,由此给您带来麻烦,请求谅解。

在故障期间,日志中大量的等待响应超时错误

StackExchange.Redis.RedisTimeoutException: Timeout awaiting response

其中的一个典型日志:

StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=6697KiB, 2937ms elapsed, timeout is 2000ms), command=GET, next: GET blog_v2_BlogPosts-291733, inst: 0, qu: 0, qs: 31, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 192.168.12.28:6379, mc: 1/1/0, mgr: 5 of 10 available, clientName: blog-web-c845b6686-zpl4s(SE.Redis-v2.5.61.22961), PerfCounterHelperkeyHashSlot: 11935, IOCP: (Busy=0,Free=1000,Min=20,Max=1000), WORKER: (Busy=19,Free=32748,Min=50,Max=32767), POOL: (Threads=73,QueuedItems=5,CompletedItems=2170212), v: 2.5.61.22961 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

在确认是 redis 引起的故障后,我们立即采取了笨方法,将之前使用 memcached 缓存的部分切换回 memcached,切换后除了个人博客博文列表页面,其他访问都已恢复正常。

个人博客博文列表一级缓存已经切换到 memcached,但二级缓存还在使用 redis,所以依然受 redis 问题影响。

这时,我们重启了 redis,但重启后问题依旧。本来我们以为是并发高触发的问题,但我们的以为错了。我们重新进行了以为,既然不是并发多的原因,那可能是数据多的原因,flushall 清空 redis 中的数据后,很快恢复了正常。

35695-20220623152344039-695219313.png

接下来我们会进一步分析问题的原因,优化 redis 的部署,目前是在 k8s 集群上部署的非高可用 redis 集群(3个节点)。

另外,上次的 k8s 集群翻船问题与我们升级 k8s 时没有升级 calico 网络组件有关,后来把网络组件换成了 cilium,本想上 eBPF 拉风一下,结果发现阿里云负载均衡与 eBPF 存在兼容问题,只好暂时作罢。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK