> CentOS > CentOS教程 >

CentOS6.4 内核优化

vi /etc/sysctl.conf


#直接在配置文件底部加入一下修改即可。


net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog =  32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800



让改动配置立即生效

/sbin/sysctl –p修改ulimit


1.vi /etc/security/limits.conf
*        soft   nproc  65535
*        hard   nproc  65535
*        soft   nofile  65535
*        hard   nofile  65535
2. vi /etc/security/limits.d/90-nproc.conf
*          soft    nproc    65535
记得重启服务器

关于ulimit的具体描述可以到一下网址查看。



http://www.ibm.com/developerworks/cn/linux/l-cn-ulimit/

(责任编辑:IT)