当前位置:网站首页>Performance problems caused by redis cache invalidation and competitive loading
Performance problems caused by redis cache invalidation and competitive loading
2022-06-27 16:54:00 【Water core cola】
redis When the cache fails , as everyone knows , If you don't protect yourself, you can allow requests to reload the cache concurrently , It will cause a large number of requests directly to the database , That is, cache breakdown occurs .
distcache To solve this problem , It uses the method of contention to obtain lock and refresh cache , Deal with cache invalidation .
such as A B Two requests arrive , stay redis Compete for locks , The thread that obtains the lock starts to look up the table and brush the cache . The thread that cannot acquire the lock starts to pass through the loop sleep The way , Query whether the cache has been flushed , Spin at regular intervals , If the cycle waiting time exceeds a certain value , Just give up .
It looks perfect , Actually caused Redis Performance problems of
mas In production environment , Find out redis Both the request delay and the request volume are in 2 There are periodic peaks around hours .
mas The number of servers in the production environment is about 200 , To single slot Interface request for qps The peak is about 6000 , The actual time required to reload the cache is not short , If it exceeds 1 second , Theoretically, it will bring 6000*20 Of redis single key qps, Already exceeded redis Maximum single node performance .
The inspiration of this question : Don't enlarge the request in the request .
边栏推荐
- 米哈游起诉五矿信托,后者曾被曝产品暴雷
- EMQ helps Qingdao Yanbo build a smart water platform
- Regular matching starts with what, ends with what, starts with what, and ends with what
- Unity 阴影——阴影平坠(Shadow pancaking)
- List to table
- 鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态
- Deeply digitise, lead cloud nativity and serve more developers
- 华为云DevCloud重磅发布四大新能力,创下国内两项第一
- 数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
- Yyds dry inventory brief chrome V8 engine garbage collection
猜你喜欢

Event listening mechanism

Redis Series 2: data persistence improves availability

Oracle概念二

Simulated process scheduling

Julia constructs diagonal matrix

IDE Eval reset unlimited trial reset
A large number of missing anchor text

米哈游起诉五矿信托,后者曾被曝产品暴雷
![[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth](/img/70/fa79ba38e28c41ed28bce2ec73cd79.png)
[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth

Data center table reports realize customized statistics, overtime leave summary record sharing
随机推荐
阿里云刘珅孜:云游戏带来的启发——端上创新
Leetcode daily practice (sum of two numbers)
Oracle concept 3
P4251 [scoi2015] small convex play matrix (still a little confused)
Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
泰山OFFICE技术讲座:第一难点是竖向定位
Redis Series 2: data persistence improves availability
The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!
锚文本大量丢失的问题
Drawing for example study of flashcc
树莓派初步使用
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
继手机之后 报道称三星也削减了电视等家电产品线的产量
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
C語言教師工作量管理系統
3.2 multiple condition judgment
Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end
【多线程】线程通信调度、等待集 wait() 、notify()
Qt5 signal and slot mechanism (basic introduction to signal and slot)
The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle