Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion benchmarks/web-serving/web_server/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ elif [ $PROTOCOL == 'http' ]; then
cat /tmp/nginx_sites_avail_pt.append >> /etc/nginx/sites-available/default
fi

FPM_CHILDREN=${5:-80}
FPM_CHILDREN=${5:-4}
WORKER_PROCESS=${6:-"auto"}

sed -i -e"s/pm.max_children = 5/pm.max_children = ${FPM_CHILDREN}/" /etc/php/${VERSION}/fpm/pool.d/www.conf
sed -i -e"s/pm = dynamic/pm = static/" /etc/php/${VERSION}/fpm/pool.d/www.conf


sed -i -e"s/worker_processes auto;/worker_processes ${WORKER_PROCESS};/" /etc/nginx/nginx.conf
sed -i -e's/;opcache.file_cache=/opcache.file_cache=\/tmp/' /etc/php/${VERSION}/fpm/php.ini

service php${VERSION}-fpm restart

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/web-serving/web_server/files/settings_4.3.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
* and CSS files. If you uncomment and configure these settings, you will not be able
* to change them from the Elgg advanced settings page.
*/
//$CONFIG->simplecache_enabled = true;
$CONFIG->simplecache_enabled = true;

/**
* Configure the boot cache TTL
Expand Down
4 changes: 2 additions & 2 deletions docs/benchmarks/web-serving.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ To start the web server, you first have to `pull` the server image by running th

To run the web server, use the following command:

$ docker run -dt --net=host --name=web_server cloudsuite/web-serving:web_server /etc/bootstrap.sh ${PROTOCOL} ${WEB_SERVER_IP} ${DATABASE_SERVER_IP} ${MEMCACHED_SERVER_IP} ${MAX_PM_CHILDREN}
$ docker run -dt --net=host --name=web_server cloudsuite/web-serving:web_server /etc/bootstrap.sh ${PROTOCOL} ${WEB_SERVER_IP} ${DATABASE_SERVER_IP} ${MEMCACHED_SERVER_IP} ${MAX_PM_CHILDREN} ${WORKER_PROCESS}

The `PROTOCOL` parameter can either be `http` or `https` and determines the web server's protocol. The `WEB_SERVER_IP`, `DATABASE_SERVER_IP`, and `MEMCACHED_SERVER_IP` parameters refer to the explicit IP of the server running each server. The `MAX_PM_CHILDREN` sets the pm.max_children in the php-fpm setting. The default value is 80.
The `PROTOCOL` parameter can either be `http` or `https` and determines the web server's protocol. The `WEB_SERVER_IP`, `DATABASE_SERVER_IP`, and `MEMCACHED_SERVER_IP` parameters refer to the explicit IP of the server running each server. The `MAX_PM_CHILDREN` sets the pm.max_children in the php-fpm setting. The default value is 4 and we recommend considering 4 per core. `WORKER_PROCESS` sets the number of Nginx worker processes. The default is `auto`. We recommend to have 1 Nginx worker process per 32 cores.

To check whether the web server is up, you can access Elgg's home page through a web browser by `http://<web_server's IP>:8080` or `https://<web_server's IP>:8443` URLs for HTTP and HTTPS web servers, respectively. For example, Elgg's home page is shown in the figure below:

Expand Down