Redis: OOM command not allowed when used memory > ‘maxmemory’
来源:互联网 发布:淘宝新店的扶持期 编辑:程序博客网 时间:2024/05/20 12:50
回到顶部
现象
日志里出现异常:
OOM command not allowed when used memory > 'maxmemory'
回到顶部
原因
内存已满,不允许再存数据了,可以通过redis-cli 查看redis的具体信息
127.0.0.1:6379> info memory# Memoryused_memory:4120248used_memory_human:3.93Mused_memory_rss:11509760used_memory_peak:1977983104used_memory_peak_human:1.84Gused_memory_lua:36864mem_fragmentation_ratio:2.79mem_allocator:jemalloc-3.6.0
注:
- used_memory_human表示已用内存
- used_memory_rss表示系统给redis分配的内存(即常驻内存)
- mem_fragmentation_ratio=used_memory_rss/used_memory比例,一般情况下,used_memory_rss略高于used_memory,当内存碎片较多时,则mem_fragmentation_ratio会较大,可以反映内存碎片是否很多
回到顶部
解决
注:如修改了配置文件需重启redis
1. 增加redis内存,修改redis.conf
maxmemory 2gb
2. 修改redis存储策略
默认的redis设置是非常保守的,即内存超限后就不在存储,可以把策略修改为LRU算法(最近最少使用算法)——新存储的信息会替换掉旧的信息,从而不会是内存越线,修改redis.conf
maxmemory-policy volatile-lru
3. 少往reids存数据
是否有必要把这么多数据存入redis?
阅读全文
0 0
- Redis: OOM command not allowed when used memory > ‘maxmemory’
- [Redis][BUG][OOM command not allowed]
- Mysql load 出现 The used command is not allowed with this MySQL version
- Mysql load 出现 The used command is not allowed with this MySQL version
- ERROR 1148 (42000): The used command is not allowed with this MySQL versio
- ERROR 1148 (42000): The used command is not allowed with this MySQL version
- Mysql load 出现 The used command is not allowed with this MySQL version
- MYSQL-执行“load data local infile”报错“The used command is not allowed with this MySQL version”
- Indicator for invoice receipt used not allowed
- Words used when reading Redis documents
- redis的maxmemory设置
- redis maxmemory设置
- redis中的maxmemory
- mysql load data infile 文件没有找到(can't get file stat) ERROR 1148: The used command is not allowed with
- ZZ: When Linux Runs Out of Memory (OOM killer)
- 【mysql+xampps】Operation not allowed when innodb_forced_recovery > 0
- idea @Override is not allowed when implementing interface method
- @Override is not allowed when implementing interface method
- 【转载】ubuntu下修复MBR
- java的数据库连接技术
- http streaming 处理流程
- Android OpenCore error code定义
- 服务器系统的分类和介绍
- Redis: OOM command not allowed when used memory > ‘maxmemory’
- 多线程实现生产者消费者
- RTSP连接服务器
- Faster R-CNN 深入理解 && 改进方法汇总
- 【转载】StageFright框架流程解读
- Android 4.2 Wifi Display 之 Settings 源码分析
- Java 常用排序算法
- Android 4.2 Wifi Display之Settings源码分析(二)
- Android 4.2 Wifi Display核心分析 (一)