首页 > 代码库 > mongodb redis 优化 (centos 7)

mongodb redis 优化 (centos 7)

mongodb (WARNING: soft rlimits too low)

 

修改配置文件 /etc/security/limits.conf,添加配置信息:

[root@localhost ~]# vi /etc/security/limits.conf

mongod soft nofile 64000  
mongod hard nofile 64000  
mongod soft nproc 32000  
mongod hard nproc 32000  

 

mongodb & redis 禁用大内存页面


vi /etc/rc.local

添加

echo 65535 > /proc/sys/net/core/somaxconn
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

 

redis 内存使用最大化

vi /etc/sysctl.conf

添加

vm.overcommit_memory=1

sysctl -p

 

mongodb redis 优化 (centos 7)