nginx: do not reduce max processes
authorPeter Stadler <redacted>
Tue, 12 May 2020 09:00:00 +0000 (11:00 +0200)
committerPeter Stadler <redacted>
Thu, 14 May 2020 07:19:45 +0000 (09:19 +0200)
Use the upstream value for NGX_MAX_PROCESSES (=1024) again.
So it is safe to use `worker_processes auto;` (which sets it to
the number of CPUs). Also use this directive in the conf instead
of calculating the number in the init and passing it as argument.

Signed-off-by: Peter Stadler <redacted>
net/nginx/Makefile
net/nginx/files/nginx.conf
net/nginx/files/nginx.init
net/nginx/patches/300-max-processes.patch [deleted file]

index cfd6b47c0f2caf302f64fe7da2c5d3700e70d5a7..2be5c6e9b41d42aa724a17e511ea5d2b6c3d3995 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
 PKG_VERSION:=1.17.10
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://nginx.org/download/
index 65d37b504484bfb98a96fb01ae6aa3545529723e..da1cbdf42965f332c70032b071827823637d658d 100644 (file)
@@ -1,6 +1,8 @@
 # Please consider creating files in /etc/nginx/conf.d/ instead of editing this.
 # For details see https://openwrt.org/docs/guide-user/services/webserver/nginx
 
+worker_processes auto;
+
 user root;
 
 events {}
index 57142950bf1377db53f8f83f44488e576bda561d..fa189931c1d5681ff1767d639f662def4b392fcc 100644 (file)
@@ -16,9 +16,8 @@ start_service() {
        ${NGINX_UTIL} init_lan
 
        procd_open_instance
-       NCPUS="$(grep -c '^processor\s*:' /proc/cpuinfo)"
        procd_set_param command /usr/sbin/nginx -c "${NGINX_CONF}" \
-               -g "daemon off; worker_processes $NCPUS;"
+               -g "daemon off;"
        procd_set_param stdout 1
        procd_set_param stderr 1
        procd_set_param file "${LAN_LISTEN}" "${LAN_LISTEN}.default" \
diff --git a/net/nginx/patches/300-max-processes.patch b/net/nginx/patches/300-max-processes.patch
deleted file mode 100644 (file)
index f7465d4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/os/unix/ngx_process.h
-+++ b/src/os/unix/ngx_process.h
-@@ -44,7 +44,7 @@ typedef struct {
- } ngx_exec_ctx_t;
--#define NGX_MAX_PROCESSES         1024
-+#define NGX_MAX_PROCESSES         8
- #define NGX_PROCESS_NORESPAWN     -1
- #define NGX_PROCESS_JUST_SPAWN    -2
git clone https://git.99rst.org/PROJECT