当前位置:网站首页>一篇搞定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问题
总结
边栏推荐
- Leetcode 301. delete invalid parentheses
- Drawing three coordinate (axis) diagram with MATLAB
- EC code introduction
- Chapter 3 business function development (choose to export market activities, Apache POI)
- Multi tenant SaaS cloud platform framework
- [binary tree] count the number of good nodes in the binary tree
- Direct insertion sort of seven sorts
- Mimx8md6cvahzab i.MX 8mdual cortex-a53 - Microprocessor
- 蓝牙框架总结
- Matplotlib multi subgraph drawing
猜你喜欢

SQL注入 Less26a(布尔盲注)

Relationship between DBM and VPP and Vpeak

时间继电器

Reed relay

Memo mode - unity

SQL injection less26a (Boolean blind injection)

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

Deepfake's face is hard to distinguish between true and false, and musk Fenke has disguised successfully

dBm和Vpp以及Vpeak的关系

Starfish OS X metabell strategic cooperation, metauniverse business ecosystem further
随机推荐
中职磐云网络安全大赛-------隐藏信息探索
The purpose of DDD to divide domains, sub domains, core domains, and support domains
Live video source code, uni app to achieve advertising scroll bar
美国疫情扩散到28个州:苹果、微软等10多万员工在家办公,iPhone11快断货了!
Chapter 3 business function development (choose to export market activities, Apache POI)
已有6名员工确诊!三星第三度关闭龟尾手机工厂!
SSM integration process
Vs2019 release mode debugging: this expression has side effects and will not be evaluated.
EC code introduction
Project analysis (what is it training that can't be given)
Behind every piece of information you collect, you can't live without TA
Vocational school Panyun network security competition ----- exploration of hidden information
Bluetooth framework summary
全国职业院校技能竞赛网络安全竞赛数据取证与分析思路分析
Project analysis (from technology to project and product)
MySQL series - database tables, queries, sorting, and data processing functions
android 11 安全策略及权限管理
只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)
Leetcode 148. sorting linked list
fork()函数的执行过程、孤儿进程和僵尸进程