nginx 在哪里打开他的文件描述符?

where does nginx opens his file descriptors?

由于打开网络套接字连接请求的负载过大,我的 nginx 出现 (23: too many open files in system) 错误。

在完全不同的机器上运行并从这个 nginx 进程接收 proxy_pass 的后端服务。 一旦达到某个阈值,我就会收到上面的错误消息。 我试图深入研究 nginx 文档,但没有找到有用的东西。 这些网络套接字的文件描述符在哪里打开和创建? 是在运行nginx进程的机器上,还是在运行服务的机器上?

我想增加每个进程允许打开的文件的限制,但我不确定我需要在哪台机器上更改它。

增加 nginx 服务器上的最大文件描述符。增加需要发生在内核和用户或 nginx 级别。 tuning guidelines 解释了原因:

File descriptors are operating system resources used to represent connections and open files, among other things. NGINX can use up to two file descriptors per connection. For example, if NGINX is proxying, it generally uses one file descriptor for the client connection and another for the connection to the proxied server, though this ratio is much lower if HTTP keepalives are used.