开发者社区> 问答> 正文

您好,我的ECS的系统出现这个报错,请问这是什么问题呢

已解决

09:36:39.900 [http-nio-9777-exec-24] ERROR c.a.f.w.e.GlobalExceptionHandler - [handleException,74] - Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: OOM command not allowed when used memory > 'maxmemory'.  
org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: OOM command not allowed when used memory > 'maxmemory'.

展开
收起
1780169608831412 2021-07-28 10:12:57 1153 0
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    您好,您这个是Redis内存空间已满。 不允许再存数据了,可以通过redis-cli 查看redis的具体信息

    127.0.0.1:6379> info memory
    # Memory
    used_memory:11287960
    **used_memory_human:10.77M**
    **used_memory_rss:23871488**
    used_memory_rss_human:22.77M
    used_memory_peak:11287960
    used_memory_peak_human:10.77M
    used_memory_peak_perc:100.00%
    used_memory_overhead:1162908
    used_memory_startup:803064
    used_memory_dataset:10125052
    used_memory_dataset_perc:96.57%
    allocator_allocated:11468016
    allocator_active:11907072
    allocator_resident:14589952
    total_system_memory:33009782784
    total_system_memory_human:30.74G
    used_memory_lua:37888
    used_memory_lua_human:37.00K
    used_memory_scripts:0
    used_memory_scripts_human:0B
    number_of_cached_scripts:0
    maxmemory:4294967296
    maxmemory_human:4.00G
    maxmemory_policy:allkeys-lru
    allocator_frag_ratio:1.04
    allocator_frag_bytes:439056
    allocator_rss_ratio:1.23
    allocator_rss_bytes:2682880
    rss_overhead_ratio:1.64
    rss_overhead_bytes:9281536
    mem_fragmentation_ratio:2.12
    mem_fragmentation_bytes:12624552
    mem_not_counted_for_evict:0
    mem_replication_backlog:0
    mem_clients_slaves:0
    mem_clients_normal:169860
    mem_aof_buffer:0
    mem_allocator:jemalloc-5.1.0
    active_defrag_running:0
    lazyfree_pending_objects:0
    
    
    used_memory_human表示已用内存
    used_memory_rss表示系统给redis分配的内存(即常驻内存)
    mem_fragmentation_ratio=used_memory_rss/used_memory比例,一般情况下,used_memory_rss略高于used_memory,当内存碎片较多时,则mem_fragmentation_ratio会较大,可以反映内存碎片是否很多
    

    解决

    1. 增加redis内存,修改redis.conf

    maxmemory 2gb
    
    

    2. 修改redis存储策略 默认的redis设置是,即内存超限后就不在存储,可以把策略修改为LRU算法(最近最少使用算法)——新存储的信息会替换掉旧的信息,从而不会是内存越多,修改redis.conf

    maxmemory-policy volatile-lru
    
    

    3. 尽可能的业务优化。 注:如修改了配置文件需重启redis

    2021-07-28 10:20:30
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS计算与存储分离架构实践 立即下载