查看某个软件打开文件限制情况
cat /proc/PID/limit 查看限制情况
修改方案
vi /etc/security/limits.conf
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
加下面项即可
root hard nofile 65535
root soft nofile 65535
其他内核优化参数
vi /etc/sysctl.conf
net.ipv4.conf.all.arp_notify = 1
fs.file-max=65535
#net.ipv4.ip_local_port_range = 1024 65536
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.core.somaxconn = 65535
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
最后执行
sysctl -p 即可
再次查看限制
cat /proc/PID/limit
PID 查看 ps aux|grep ngrok
其他备注情况
net.ipv6.conf.all.forwarding=2
net.ipv6.conf.eth0.accept_ra = 2
net.ipv6.conf.all.proxy_ndp=1