redis啟動報錯(TCP backlog setting of 511/overcommit_memory is set to 0/THP)
-
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1 vim /etc/sysctl.conf
2
3 ```
4 # 添加內容
5 net.core.somaxconn = 1024
6 vm.overcommit_memory = 1
7 ```
8
9 /sbin/sysctl -p
-
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.
加入上一個問題的代碼就可以解決
-
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.
追加代碼到 /etc/rc.local 配置中
1 if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
2 echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
3 fi

浙公網安備 33010602011771號