ulimit -n 65535,永久修改 /etc/security/limits.conf,添加 * soft nofile 65535 和 * hard nofile 65535。/etc/sysctl.conf,添加以下参数并执行 sysctl -p:net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 30
cluster模块利用多核CPU,提升并发处理能力。async/await避免阻塞,使用node-cache或Redis缓存频繁请求的数据。