在实际工作中,观察到单台Linux服务器超过1万个连接时(16core+32G Ram),系统进入不稳定期,如果提升连接数?
http://www.kegel.com/c10k.html
https://github.com/yaocoder/HPNetServer
环境:
#uname -a
Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
#cat /etc/redhat-release
CentOS release 6.5 (Final)
16 core + 32G Ram
修改一些基本配置
#ulimit -n 1000000
#cat /etc/security/limits.conf
* soft nofile 1000000
* hard nofile 1000000
#cat /proc/sys/fs/file-max
1000000
#vi /etc/rc.local
ulimit -SHn 1000000
#vi /etc/sysctl.conf
fs.file-max = 1000000
#cat /proc/sys/fs/file-nr
#输出三段数字的解释 1.已经分配的文件句柄数,2.已经分配但没有使用的文件句柄数,3.最大文件句柄数。
陆续更新