mirror of
https://github.com/linuxserver/docker-swag.git
synced 2025-02-13 05:11:22 -05:00
Use nproc to detect available cpus
This commit is contained in:
parent
49bd204b51
commit
2ea807dd02
@ -90,7 +90,7 @@ fi
|
|||||||
|
|
||||||
# Set worker_processes
|
# Set worker_processes
|
||||||
if ! grep -q 'worker_processes' /config/nginx/worker_processes.conf; then
|
if ! grep -q 'worker_processes' /config/nginx/worker_processes.conf; then
|
||||||
WORKER_PROCESSES=$(wc -w < /sys/fs/cgroup/cpuacct/cpuacct.usage_percpu)
|
WORKER_PROCESSES=$(nproc)
|
||||||
echo "Setting worker_processes to ${WORKER_PROCESSES}"
|
echo "Setting worker_processes to ${WORKER_PROCESSES}"
|
||||||
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
|
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
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user