Failed to save in background (redis-server)

I have two redis servers running on the same computer. The second log file contains several instances with these notifications:

[50818] 19 Feb 06:41:05.007 * 10 changes in 300 seconds. Saving...
[50818] 19 Feb 06:41:05.007 # Can't save in background: fork: Cannot allocate memory

In contrast, the log files of the first contain only the successful preservation of the database. If I had no memory, I would assume that both would have the same logs. It puzzles me that only one has this problem, the other does not. Any conclusions?

In addition, research led me to this blog post stating that the problem could be improved if I did a sysctl vm.overcommit_memory=1command line. There is no explanation of how this helps. Can someone explain what is happening here in the context of redis?

+4
source share
1 answer

As Per Redis Frequently Asked Questions :

Saving background with fork () error under Linux, even if I have a lot of free memory!

Short answer: echo 1 > /proc/sys/vm/overcommit_memory:)

And now the long one:

Redis : Redis ( ), . , , . , , copy-on-write, . , . , , Linux , , , overcommit_memory , , , , Redis 3 2 . . overcommit_memory 1 , Linux , Redis.

, , Linux overcommit_memory overcommit_ratio - Red Hat Magazine, " ". , 1 2 overcommit_memory: proc (5) man .

+14

Source: https://habr.com/ru/post/1670995/


All Articles