Tigase在linux环境下单机(云虚拟主机)成功建立30万用户长连接,对LINUX系统进行了一系列优化。
测试环境:
Ubuntu 12.04 64位 CPU 8核32G内存硬盘20G云虚拟主机
JDK1.7 64位
Tigase5.2.3
Smack4
调优参数如下:
/etc/profile文件中:
ifconfig eth0 txqueuelen 5000
export LANG=zh_CN.GB18030
export
LANGUAGE=zh_CN.GB18030:zh_CN.GB2312:zh_CN
ulimit -n 655350
/etc/sysctl.conf文件中:
fs.file-max = 1048576
net.ipv4.ip_local_port_range = 1024 655350
net.core.somaxconn = 2048
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 4096 16777216
net.ipv4.tcp_wmem = 4096 4096 16777216
net.ipv4.tcp_mem = 786432 2097152 3145728
net.ipv4.tcp_max_syn_backlog = 16384
net.core.netdev_max_backlog = 20000
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_orphans = 131072
kernel.pid_max = 800000
vm.max_map_count = 861072
kernel.threads-max = 800000
/etc/security/limits.conf文件中:
* softnofile 1048576
* hardnofile 1048576