当前位置:网站首页>Redis lost key and bigkey
Redis lost key and bigkey
2022-04-23 05:04:00 【canger_】
lose key ( Cache pollution
- The phenomenon : There are always redis-key Lost situation , Yesterday's key Not today
- Investigation angle :
- 1、key Whether to set the expiration time
- 2、 Check key Delete logic
- 3、 see redis Whether the memory used in is close to maxmemory, Causes the memory obsolescence policy to be triggered
- If this is the third case , Set according to the business scenario config
- modify redis-config
- modify maxmemory
- modify maxmemory-policy from allkeys-lru Change it to volatile-lru
- See what key It takes up a lot of memory (bigkeys screening ), And see if the timeout is set
- modify redis-config
bigkeys
bigkeys:hash/set/zset There are a lot of elements in ,string The data stored is very large
- harm :
- 1、 Blocking 、redis It's single threaded , Yes bigkeys The operation of will cause blocking of other commands , Lead to a large number of redis A series of problems such as operation exceeding and reporting errors
- 2、 Be overdue / When deleted, it will block , If it is redis4.0 Later versions , Asynchronous deletion can be used to solve (lazy-free/unlink)
- 3、 Memory is unevenly distributed , For example redis-cluster It will cause uneven use of node memory , Increase the processing pressure of a single instance
- screening bigkeys Methods :
- 1、redis-cli --bigkeys
- 2、 Use open source tools ,redis-rdb-tools To analyze redis Of key Distribution situation https://github.com/sripathikrishnan/redis-rdb-tools
rdb --command json dump.rdb
- resolvent :
- Optimize storage solutions
- bigkey Split , Fragmentation storage
- Save to database
- Set expiration time, etc
- Optimize storage solutions
版权声明
本文为[canger_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220552063226.html
边栏推荐
- How can continuous integration (CI) / continuous delivery (CD) revolutionize automated testing
- Jetpack -- lifecycle usage and source code analysis
- View analysis of scenic spots in ArcGIS
- MySQL circularly adds sequence numbers according to the values of a column
- Chapter III project schedule management of information system project manager summary
- JS determines whether the numeric string contains characters
- Deep learning notes - fine tuning
- Informatics Olympiad 1955: [11noip popularization group] Swiss round | openjudge 4.1 4363: Swiss round | Luogu p1309 [noip2011 popularization group] Swiss round
- Agile practice | agile indicators to improve group predictability
- Deep learning notes - data expansion
猜你喜欢
Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases
[database] MySQL single table query
How can continuous integration (CI) / continuous delivery (CD) revolutionize automated testing
What are the redis data types
Learning Android from scratch -- Introduction
深度学习笔记 —— 微调
Deep learning notes - semantic segmentation and data sets
2022/4/22
Basic theory of Flink
Independent station operation | Facebook marketing artifact - chat robot manychat
随机推荐
Streamexecutionenvironment of Flink source code
[WinUI3]編寫一個仿Explorer文件管理器
Using MySQL with Oracle
Transaction isolation level of MySQL transactions
Innovation training (VI) routing
Analysis of POM files
Field injection is not recommended using @ Autowired
MySQL -- execution process and principle of a statement
Leetcode 1547: minimum cost of cutting sticks
Innovation training (II) task division
Deep learning notes - semantic segmentation and data sets
独立站运营 | FaceBook营销神器——聊天机器人ManyChat
SCP command details
MySQL memo (for your own query)
Introduction to load balancing
Customize the navigation bar at the top of wechat applet (adaptive wechat capsule button, flex layout)
The WebService interface writes and publishes calls to the WebService interface (I)
Harmonious dormitory (linear DP / interval DP)
JS détermine si la chaîne de nombres contient des caractères
信息学奥赛一本通 1212:LETTERS | OpenJudge 2.5 156:LETTERS