For my custom CentOS based OpenLiteSpeed install tests, I am starting to tweaking a few settings in default httpd_config.xml and dynamically setting the number of workers according to my server's cpu count now.
But why not do this by default instead of leaving it blank = 1 worker out of the box ?
i.e. Tweak default OpenLiteSpeed settings /usr/local/lsws/conf/httpd_config.xml:
I guess it's probably to leave some cpus for serving LSPHP processes ?
Maybe give half to OpenLiteSpeed and half to LSPHP processes ?
Better than just 1 cpu worker ?
But why not do this by default instead of leaving it blank = 1 worker out of the box ?
i.e. Tweak default OpenLiteSpeed settings /usr/local/lsws/conf/httpd_config.xml:
Code:
CPUS=$(grep "processor" /proc/cpuinfo |wc -l)
WORKERCHECK=$(grep '<httpdWorkers>' /usr/local/lsws/conf/httpd_config.xml)
if [[ -z "$WORKERCHECK" ]]; then
sed -i "4 i\ <httpdWorkers>${CPUS}<\/httpdWorkers>" /usr/local/lsws/conf/httpd_config.xml
fi
Maybe give half to OpenLiteSpeed and half to LSPHP processes ?
Code:
CPUS=$(grep "processor" /proc/cpuinfo |wc -l)
CPUS=$(echo $CPUS/2 | bc)
WORKERCHECK=$(grep '<httpdWorkers>' /usr/local/lsws/conf/httpd_config.xml)
if [[ -z "$WORKERCHECK" ]]; then
sed -i "4 i\ <httpdWorkers>${CPUS}<\/httpdWorkers>" /usr/local/lsws/conf/httpd_config.xml
fi