Redis:oom command not allowed when used memory > ' maxmemory '

Source: Internet
Author: User

Phenomenon

An exception occurred in the log:

' MaxMemory '
Reason

The memory is full, no more data is allowed, and you can view the details of Redis via REDIS-CLI

 127.0 . 0.1 : 6379  >  info memory# memoryused_memory:  4120248  used_memory_human:  3.93m  used_memory_rss:  11509760  used_memory_peak:  1977983104  used_memory_peak_human:  1  .84gused_memory_lua:  36864  mem_fragmentation_ratio:  2.79  mem_allocator:jemalloc -0  

Note:

    • Used_memory_human indicates that memory is used
    • Used_memory_rss represents the memory allocated by the system to Redis (that is, resident memory)
    • Mem_fragmentation_ratio=used_memory_rss/used_memory ratio, generally, used_memory_rss is slightly higher than used_memory, and when memory fragmentation is high, mem_ Fragmentation_ratio will be larger, can reflect the memory fragmentation is many
Solve

Note: If you modify the configuration file, you need to restart Redis

1. Increase Redis memory, modify redis.conf

MaxMemory 2GB

2. Modify the Redis Storage Policy

The default Redis settings are very conservative, that is, the memory is not stored after the overrun, you can change the policy to the LRU algorithm (least recently used algorithm)-The newly stored information will replace the old information, so it will not be the memory line, modify redis.conf

volatile-lru

3. Save less data to Reids

Is it necessary to deposit so much data into Redis?

Redis:oom command not allowed when used memory > ' maxmemory '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.