CentOS -- Redis 3.2.12 Standalone Install and Configuration

1 Tune OS setting 

echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
echo "vm.swappiness=1" >> /etc/sysctl.conf
echo "net.core.somaxconn=65535" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog=65535" >> /etc/sysctl.conf
echo "redis soft nofile 288000" >> /etc/security/limits.conf
echo "redis hard nofile 288000" >> /etc/security/limits.conf 
ulimit -Hn -Sn
echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag' >> /etc/rc.d/rc.local
echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.d/rc.local

2 Configure Redis

#configuration file: /etc/redis.conf
#Most of Redis parameters are good enough for start point(cache purpose only)
#we need setup below parameters:
maxclients
maxmemory
requirepass

3 Enable redis startup along with OS

systemctl enable redis
service redis start
上一篇:架构师养成记--20.netty的tcp拆包粘包问题


下一篇:iOS 程序员 6 级考试(答案和解释)