Skip to content

Commit 2ea807d

Browse files
authored
Use nproc to detect available cpus
1 parent 49bd204 commit 2ea807d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

root/etc/cont-init.d/50-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fi
9090

9191
# Set worker_processes
9292
if ! grep -q 'worker_processes' /config/nginx/worker_processes.conf; then
93-
WORKER_PROCESSES=$(wc -w < /sys/fs/cgroup/cpuacct/cpuacct.usage_percpu)
93+
WORKER_PROCESSES=$(nproc)
9494
echo "Setting worker_processes to ${WORKER_PROCESSES}"
9595
echo "# This file is auto-generated only on first start, based on the cpu cores detected. Feel free to change it to any other number or to auto to let nginx handle it automatically.\nworker_processes ${WORKER_PROCESSES};" > /config/nginx/worker_processes.conf
9696
fi

0 commit comments

Comments
 (0)