1. 程式人生 > >REDIS 學習(7) 啟動時的幾個異常排除

REDIS 學習(7) 啟動時的幾個異常排除

一,

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

/etc/sysctl.conf 中的overcommit_memory這個引數有三個值可以選

0,核心將檢查是否有足夠的可用記憶體供應用程式使用,如果有則允許申請,反之返回錯誤

1,永遠允許

2,允許超過所有實體記憶體和交換空間的記憶體總和

按照提示解決方式如下:


然後使配置生效 

       

齊活兒。

二,

WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

解決方式

echo 511 > /proc/sys/net/core/somaxconn

齊活兒。

三,

WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

解決方式,禁止通明大頁

echo never > /sys/kernel/mm/transparent_hugepage/enabled

齊活兒。