Our Magento 2 site has a problem with Redis memory usage/availability. Redis is not able to allocate additional memory and overcommit is turned off. At a seemingly random time, the site will no longer work. A general exception appears and in the report folder the following message is shown

"MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

The redis server log has the following Can't save in background: fork: Cannot allocate memory

The redis instance has 18gb maxmemory set and allkeys-lfu as an eviction policy. I don't understand why this policy did not take effect. It should purge the least used keys but instead did nothing and the server crashed.

Today the site was down, but when I logged in, the server had 18 out of 36gb available. (site still down)

I phone rackspace and their senior support said that even though the server had available memory that the kernel was denying the application a specific chunk size of memory. I asked them not to reboot the instance while we investigate but they did anyway. I don't understand, if the server has significant memory available why it is still crashed.

Rackspace solution was to enable redis to overcommit/write to disk. I see this setting is also recommended in the admin documentation for redis, but not understanding the sudden urgency for large chunks of ram and then crashing, and also the eviction policy seemingly having no effect. Setting overcommit just seems like throwing disk at a program that wants gigs and gigs of ram at certain times when it could run for weeks and be fine.

I would like another opinion on the issue. I did not see any unusual activity or spikes in the request log, such as a lot of bot traffic or a scraper.

Magento 2.3.3 Server has 36gb of memory. DB is on separate server. maxmemory = 16GB maxmemory-policy allkeys-lfu

  • Can you add exact error that you get from Magento? Also 18gb is too much for me, is there any reason for this?
    – KAndy
    Mar 9, 2020 at 1:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.