[PATCH] Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)

i at morfi.ru i at morfi.ru
Thu Oct 24 13:38:38 UTC 2019


# HG changeset patch
# User Andrey Kolyshkin <i at morfi.ru>
# Date 1571924112 -10800
#      Thu Oct 24 16:35:12 2019 +0300
# Node ID dfae615e676214a83b91abfbb51c334cfb1ecfdd
# Parent  89adf49fe76ada86d84e2af8f5cee9ca8c3dca19
Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)

diff -r 89adf49fe76a -r dfae615e6762 src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c	Mon Oct 21 20:22:30 2019 +0300
+++ b/src/os/unix/ngx_process_cycle.c	Thu Oct 24 16:35:12 2019 +0300
@@ -811,6 +811,8 @@
             ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
                           "setrlimit(RLIMIT_NOFILE, %i) failed",
                           ccf->rlimit_nofile);
+        } else {
+            ngx_max_sockets = ccf->rlimit_nofile;
         }
     }
 


More information about the nginx-devel mailing list