当前位置:网站首页>一篇搞定Redis中的BigKey问题
一篇搞定Redis中的BigKey问题
2022-07-27 19:54:00 【InfoQ】
redis中的BigKey问题及解决方案
BigKey问题是什么
BigKey问题怎么产生
- redis中的key-value键值对设置不当,造成key对应的value值特别大。
- 对于list,set这种类型的结构,无效的数据没有及时的删除。
- 对业务分析不准确,导致实际业务中value值过大,如热点问题。
BigKey问题怎么定位
- 使用redis自带的命令 redis-cli --bigkeys 在线扫描大key,显示的信息不详细,并且这个命令不是阻塞的,所以不影响redis的正常使用。

- 使用第三方工具redis-rdb-tools,使用过程中会先使用bgsave命令dump一个rdb镜像,然后对这个镜像进行分析,因为bgsave是redis中的一个子线程进行生成镜像的,并不影响redis对外提供服务。
- debug object方法
C:\Users\93676\Desktop>redis-cli
127.0.0.1:6379> set a "sadasd"
OK
127.0.0.1:6379> debug object a
Value at:00007FCD3EC12FE0 refcount:1 encoding:embstr serializedlength:7 lru:14754079 lru_seconds_idle:15BigKey造成的影响
- 占用内存增大
- 网络阻塞延迟变大
- IO阻塞延迟增大
- BigKey迁移困难
BigKey问题如何解决
- 针对BigKey进行拆分
- 清理无效的数据
- 压缩对应的BigKey的value
- 监控Redis中内存,带宽,增长率
温馨提醒:这个有点多,请仔细看下去拓展
热key问题
总结
边栏推荐
- 7行代码让B站崩溃3小时
- 直播app系统源码,上下叠层样式的轮播图
- mmu学习总结
- Direct insertion sort of seven sorts
- Window localstorage properties and location objects
- Credit default prediction based on simplified scorecard, smote sampling and random forest
- EC code introduction
- SQL injection less29 (parameter pollution bypasses WAF)
- Excel only wants to visualize charts and make data move? Yes, come and watch (with a large number of templates to download)
- Cache learning
猜你喜欢

SQL injection less29 (parameter pollution bypasses WAF)

Multi tenant SaaS cloud platform framework

leetcode15--三数之和

只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)

七大排序之希尔排序

Nine days later, we are together to focus on the new development of audio and video and mystery technology

Vs2019 release mode debugging: this expression has side effects and will not be evaluated.

Vocational school Panyun network security competition ----- exploration of hidden information

Polarization relay

dBm和Vpp以及Vpeak的关系
随机推荐
Principle and application of CMOS transmission gate
时间继电器
Leetcode-152- product maximum subarray
jumpserver学习
ADI、世健、骏龙科技共同捐赠230万元助力湖北抗疫
Leetcode-199-right view of binary tree
Leetcode-55-jump game
直播软件app开发,uniapp scroll-view隐藏滚动条
Are Transformers Effective for Time Series Forecasting?| Pit filling
Window localStorage 属性和Location 对象
If demand splitting is as simple as cutting a cake | agile practice
Time relay
Deploy dolphin scheduler high availability cluster based on rainbow
In depth understanding of redis master-slave principle
7行代码让B站崩溃3小时
MMU learning summary
Behind every piece of information you collect, you can't live without TA
2022 / July daily report
Wireshark filter rule notes, with software
SQL注入 Less29(参数污染绕过WAF)