BGREWRITEAOF used up 2x used_memory but should not

111 views
Skip to first unread message

rr Feng

unread,
Mar 17, 2016, 2:00:21 AM3/17/16
to Redis DB
I have a redis instance on a 16GB Linux server,and info memory says:
# Memory
used_memory:6886805512
used_memory_human:6.41G
used_memory_rss:8742027264
used_memory_peak:8470300536
used_memory_peak_human:7.89G
used_memory_lua:36864
mem_fragmentation_ratio:1.27
mem_allocator:jemalloc-3.6.0

and the log:
[1524] 13 Mar 03:00:01.636 * Background append only file rewriting started by pid 6563
[6563] 13 Mar 03:01:46.309 * SYNC append only file rewrite performed
[6563] 13 Mar 03:01:46.318 * AOF rewrite: 7590 MB of memory used by copy-on-write
[1524] 13 Mar 03:01:46.431 * Background AOF rewrite terminated with success
[1524] 13 Mar 03:01:46.433 * Parent diff successfully flushed to the rewritten AOF (2801268 bytes)
[1524] 13 Mar 03:01:46.434 * Background AOF rewrite finished successfully
[1524] 14 Mar 03:00:01.912 # Can't rewrite append only file in background: fork: Cannot allocate memory
[1524] 15 Mar 03:00:01.773 # Can't rewrite append only file in background: fork: Cannot allocate memory
[1524] 16 Mar 03:00:01.676 * Background append only file rewriting started by pid 24154
[1524] 16 Mar 03:00:34.719 # Background AOF rewrite terminated by signal 9

I set save off, and appendonly on, but not auto-rewrite-aof. when the ops is lowest of the day(3:00 am) I run a script to call bgrewriteaof.

"Parent diff successfully flushed to the rewritten AOF (2801268 bytes)" indicates that not many write operations on the rewrite(Am I right? ).

Nothing else running on this server.

Why OOM kill?

Thanks! 


Tuco

unread,
Mar 18, 2016, 1:34:18 AM3/18/16
to Redis DB
what is the output of  "cat /proc/sys/vm/overcommit_memory".
If it is 0, you need to run, "echo 1 > cat /proc/sys/vm/overcommit_memory". 
The details are here
Reply all
Reply to author
Forward
0 new messages