<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Here are the additional details:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ uname -a</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Linux a002 4.15.0-177-generic #186-Ubuntu SMP Thu Apr 14 20:23:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux</span></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ cat /etc/lsb-release</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">DISTRIB_ID=Ubuntu</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">DISTRIB_RELEASE=18.04</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">DISTRIB_CODENAME=bionic</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"</span></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ cat /etc/os-release</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">NAME="Ubuntu"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">VERSION="18.04.6 LTS (Bionic Beaver)"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ID=ubuntu</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ID_LIKE=debian</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">PRETTY_NAME="Ubuntu 18.04.6 LTS"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">VERSION_ID="18.04"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">HOME_URL="<a href="https://www.ubuntu.com/" class="">https://www.ubuntu.com/</a>"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">SUPPORT_URL="<a href="https://help.ubuntu.com/" class="">https://help.ubuntu.com/</a>"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">BUG_REPORT_URL="<a href="https://bugs.launchpad.net/ubuntu/" class="">https://bugs.launchpad.net/ubuntu/</a>"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">PRIVACY_POLICY_URL="<a href="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" class="">https://www.ubuntu.com/legal/terms-and-policies/privacy-policy</a>"</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">VERSION_CODENAME=bionic</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">UBUNTU_CODENAME=bionic</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ ulimit -Hn</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">1048576</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ ulimit -Sn</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">1024</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ cat /proc/sys/fs/file-max</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">262144</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="color: rgb(23, 43, 77); font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; font-variant-ligatures: normal; orphans: 2; white-space: pre; widows: 2; background-color: rgb(244, 245, 247); text-decoration-thickness: initial;" class="">worker_rlimit_nofile 65535;</span></span></div><div class=""><br class=""></div><div class="">The ulimits are for the user that nginx runs at (only the master process runs as root).</div><div class=""><br class=""></div><div class="">Roger</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 7, 2022, at 2:29 PM, Sergey A. Osokin <<a href="mailto:osa@freebsd.org.ru" class="">osa@freebsd.org.ru</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Tue, Jun 07, 2022 at 01:18:36PM -0700, Roger Fischer wrote:<br class=""><blockquote type="cite" class=""><br class="">We are simulating 1000 clients. Some get cache hits, and some go upstream. So there are more than 1000 connections.<br class=""><br class="">We have 24 workers running, each configured: events { worker_connections  1024; }<br class=""><br class="">We are seeing the following errors from nginx:<br class="">[warn] 21151#21151: 1024 worker_connections are not enough, reusing connections<br class="">[crit] 21151#21151: accept4() failed (24: Too many open files)<br class="">[alert] 21151#21151: *15716 socket() failed (24: Too many open files) while connecting to upstream,<br class=""><br class="">I am assuming the second and third error are for the OS limit. But the first seems to be from a worker process.<br class=""></blockquote><br class="">That looks like OS or user account limits, so could you share an<br class="">output of the followoing commands:<br class=""><br class="">% uname -a<br class="">% cat /etc/*release<br class="">% ulimit -Hn<br class="">% ulimit -Sn<br class="">% cat /proc/sys/fs/file-max<br class=""><br class="">Also, it's possible to increase nginx limits with the worker_rlimit_nofile<br class="">directive, <a href="http://nginx.org/ru/docs/ngx_core_module.html#worker_rlimit_nofile" class="">http://nginx.org/ru/docs/ngx_core_module.html#worker_rlimit_nofile</a><br class=""><br class="">Thank you.<br class=""><br class="">--<br class="">Sergey A. Osokin<br class="">_______________________________________________<br class="">nginx mailing list -- <a href="mailto:nginx@nginx.org" class="">nginx@nginx.org</a><br class="">To unsubscribe send an email to <a href="mailto:nginx-leave@nginx.org" class="">nginx-leave@nginx.org</a><br class=""></div></div></blockquote></div><br class=""></div></body></html>