cd /usr/local/src/ wget http://download.redis.io/releases/redis-4.0.14.tar.gz tar xvf redis-4.0.14.tar.gz && cd redis-4.0.14 make PREFIX=/usr/local/redis-4.0.14 install cd /usr/local/ && ln -s redis-4.0.14 redis
11268:M 12 Aug 16:11:13.026 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
vim /etc/sysctl.conf # 增加内核参数 net.core.somaxconn = 1024
sysctl -p # 立即生效
2.overcommit_memory
警告
1
11268:M 12 Aug 16:11:13.026 # 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.
vim /etc/sysctl.conf # 增加内核参数 vm.overcommit_memory= 1
sysctl -p # 立即生效
3.transparent_hugepage
警告
1
11392:M 12 Aug 16:17:16.429 # 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.
解决措施
1 2
# 如下配置,同时追加到/etc/rc.local echo never > /sys/kernel/mm/transparent_hugepage/enabled