all: here is my server memory info with 'free -m'
total used free shared buffers cached
Mem: 64433 49259 15174 0 3 31
-/+ buffers/cache: 49224 15209
Swap: 8197 184 8012
my redis-server has used 46G memory, there is almost 15G memory left free
As my knowledge,fork is copy on write, it should not failed when there has 15G free memory,which is enough to malloc necessary kernel structures .
besides, when redis-server used 42G memory, bgsave is ok and fork is ok too.
Is there any vm parameter I can tune to make fork return success ?
Thanks.
From proc(5) man pages:
Modify
/etc/sysctl.conf
and add:Then restart sysctl with:
On FreeBSD:
On Linux:
More specifically, from the Redis FAQ
Redis doesn't need as much memory as the OS thinks it does to write to disk, so may pre-emptively fail the fork.