Optimise web server for number of cpu cores
This commit is contained in:
parent
f385b91330
commit
3b16599b6f
|
@ -106,6 +106,9 @@ CONFIGURATION_FILE="freedombone.cfg"
|
||||||
|
|
||||||
SSH_PORT=2222
|
SSH_PORT=2222
|
||||||
|
|
||||||
|
# number of CPU cores
|
||||||
|
CPU_CORES=1
|
||||||
|
|
||||||
# The static IP address of the system within the local network
|
# The static IP address of the system within the local network
|
||||||
LOCAL_NETWORK_STATIC_IP_ADDRESS="192.168.1.60"
|
LOCAL_NETWORK_STATIC_IP_ADDRESS="192.168.1.60"
|
||||||
|
|
||||||
|
@ -341,6 +344,9 @@ function read_configuration {
|
||||||
if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then
|
if grep -q "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE; then
|
||||||
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep "LOCAL_NETWORK_STATIC_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
if grep -q "CPU_CORES" $CONFIGURATION_FILE; then
|
||||||
|
CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
|
fi
|
||||||
if grep -q "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE; then
|
if grep -q "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE; then
|
||||||
WEBSERVER_LOG_LEVEL=$(grep "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
WEBSERVER_LOG_LEVEL=$(grep "WEBSERVER_LOG_LEVEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
@ -2997,6 +3003,8 @@ function install_web_server {
|
||||||
exit 51
|
exit 51
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sed -i "s/worker_processes 4;/worker_processes $CPU_CORES;/g" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# install a script to easily enable and disable nginx virtual hosts
|
# install a script to easily enable and disable nginx virtual hosts
|
||||||
if [ ! -d $INSTALL_DIR ]; then
|
if [ ! -d $INSTALL_DIR ]; then
|
||||||
mkdir $INSTALL_DIR
|
mkdir $INSTALL_DIR
|
||||||
|
|
Loading…
Reference in New Issue