0

我们的 node.js 应用程序将被大量加载,所以我想知道是否有我应该适当配置的 Linux(Ubuntu 服务器)内核设置?

现在我正在考虑打开文件描述符的限制:

cat /etc/security/limits.d/nodeuser.conf
nodeuser     soft    nofile  65535
nodeuser     hard    nofile  65535

是否有任何其他内核/用户进程可调参数应该为 Node.js 提供一些推荐值?

4

1 回答 1

0

我过去使用过这个很棒的帖子:

https://engineering.gosquared.com/optimising-nginx-node-js-and-networking-for-heavy-workloads

以我的经验,最重要的是减少连接在关闭(net.ipv4.tcp_tw_reusenet.ipv4.tcp_fin_timeout)后在 TIME_WAIT 中花费的时间。否则,您可能会很快用完打开的端口。

正如您所建议的,您还需要增加文件描述符的数量。

于 2013-09-18T15:57:41.837 回答