ulimit –ahtml
ulimit –ncentos
#vi /erc/security/limits.conf (修改文件开启的限制)安全
#性能优化
#<domain> <type> <item> <value>服务器
#dom
#* soft core 0性能
#* hard rss 10000优化
#@student hard nproc 20spa
#@faculty soft nproc 20.net
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
* soft noproc 10000(可选)
* hard noproc 10000(可选)
* soft nofile 65535
* hard nofile 65535 (添加的两行)
# End of file
:wq 保存退出
说明:
* 表明针对全部用户
noproc 是表明最大进程数
nofile 是表明最大文件打开数
注意:
这个当中的硬限制是实际的限制,而软限制是warnning限制,只会作出warning;
执行下面的两条命令
ulimit –Hn 65535
ulimit –Sn 65535
最后重启系统才能生效 reboot
在查看 ulimit –n
#ulimit –n
65535
已打开文件数限制,已调至最大。
参考:
CentOS 6.5安全加固及性能优化:
http://os.51cto.com/art/201312/423095.htm
生产服务器环境最小化安装后 Centos 6.5优化配置备忘: