Erlang - High Concurrence Running
1. unlimit -n
/etc/security/limits.conf:
* soft nofile 1000000
* hard nofile 1000000
/etc/rc.local:
ulimit -SHn 1000000
2.
/proc/sys/fs/file-nr
/proc/sys/fs/file-max
cat /proc/sys/fs/file-nr -> 9344 0 592026
分别为:1.已经分配的文件句柄数,2.已经分配但没有使用的文件句柄数,3.最大文件句柄数
/etc/sysctl.conf:
fs.file-max = 1000000
net.ipv4.ip_conntrack_max = 1000000
net.ipv4.netfilter.ip_conntrack_max = 1000000
3. /proc/sys/net/ipv4/ip_local_port_range
echo 20000 62000 > /proc/sys/net/ipv4/ip_local_port_range
4. erlang params
erlang +P 1000000 +Q 1000000 +K true