我的阿里云服务器ECS的系统出现这个报错,请问这是什么问题呢?

客户问题场景:

我的阿里云服务器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'.
 

凯铧互联技服回复:

这个故障是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年818优惠准备中!

爆款产品:阿里云服务器|云数据库|云安全0.5折起 详情访问了解更多:https://partner.aliyun.com/shop/30466075
 

以上就是我的阿里云服务器ECS的系统出现这个报错的说明。凯铧互联提供阿里云服务器/腾讯云服务器/华为云服务器/百度云服务器等产品的代购服务,为您提供云产品专属优惠折扣,通过凯铧互联购买可以获得折上折,若您需要帮助可以直接联系我方客服!同样的品质,更多贴心的服务,阿里云代理商凯铧互联专业技术团队同时为您提供便捷专业的7x24一对一专业全面的技术服务。 电话专线:136-5130-9831,QQ:3398234753。

为什么选择我们:北京凯铧互联科技有限公司(简称凯铧互联)由多名前阿里云资深技术专家创立,核心员工来自阿里巴巴、腾讯等,作为阿里云,华为云,腾讯云,百度云,金山云,华为云重要的合作伙伴,专注于为企业用户提供云计算及基于云服务器的解决方案。总部设在北京,并在内蒙设有办事处。做为一家综合性方案商,凯铧互联向各行业用户提供基于云服务器的各种解决方案。为用户获得优质服务的同时,秉承"专业规划、周到服务"的服务理念,根据用户的实际情况,充分考虑各种网络资源的特点及功效,为用户量身定做一套适合于其实际应用需求的网络应用方案。帮助用户利用互联网的力量展开新的营销方式,并大大缩短了项目实施周期,获得用户的一致好评。

本公司销售:阿里云、腾讯云、百度云、天翼云、金山大米云、金山企业云盘!可签订合同,开具发票。
?