diff --git a/.devilbox/www/config.php b/.devilbox/www/config.php index 5d7565f08..5aaa81962 100644 --- a/.devilbox/www/config.php +++ b/.devilbox/www/config.php @@ -14,7 +14,7 @@ $DEVILBOX_VERSION = 'v0.15'; -$DEVILBOX_DATE = '2019-03-01'; +$DEVILBOX_DATE = '2019-03-04'; $DEVILBOX_API_PAGE = 'devilbox-api/status.json'; // diff --git a/CHANGELOG.md b/CHANGELOG.md index 30bea6916..c861da170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ major versions. - Reverse Proxy support - Autostart scripts - Allow to enable/disable PHP modules +- Allow to set Nginx worker_processes via .env +- Allow to set Nginx worker_connections via .env - Intranet vendors - PHPRedMin - Mount options for volumes @@ -88,6 +90,7 @@ major versions. - Fixed hostnames for all Docker container - PHP-FPM workers changed from `dynamic` to `ondemand` - Allow Apache to server underscore domains +- Changed Nginx `client_max_body_size` to `0` to be in sync with Apache #### Fixed - break on errors in wrong vhost-gen overwrite diff --git a/docker-compose.yml b/docker-compose.yml index 18947b688..bdfb614f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -210,7 +210,7 @@ services: # Web Server # ------------------------------------------------------------ httpd: - image: devilbox/${HTTPD_SERVER}:0.29 + image: devilbox/${HTTPD_SERVER}:0.30 hostname: httpd environment: @@ -233,6 +233,12 @@ services: - NEW_UID - NEW_GID + ## + ## Nginx specific worker/connection settings + ## + - WORKER_PROCESSES=${HTTPD_NGINX_WORKER_PROCESSES:-auto} + - WORKER_CONNECTIONS=${HTTPD_NGINX_WORKER_CONNECTIONS:-1024} + ## ## Disable default vhost? ## diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index 366ad0fd4..3d7e5e67c 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -1518,6 +1518,47 @@ than ``max_execution_time``, you will get a proper PHP error message in the brow | ``HTTPD_TIMEOUT_TO_PHP_FPM`` | positive integer | ``180`` | +------------------------------+-------------------+------------------+ +HTTPD_NGINX_WORKER_PROCESSES +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Defines the number of worker processes for Nginx, i.e, the number of CPU cores. + +The optimal value depends on many factors including (but not limited to) the number of CPU cores, +the number of hard disk drives that store data, and load pattern. When one is in doubt, setting it +to the number of available CPU cores would be a good start +(the value “auto” will try to autodetect it). + ++----------------------------------+-----------------------------+------------------+ +| Name | Allowed values | Default value | ++==================================+=============================+==================+ +| ``HTTPD_NGINX_WORKER_PROCESSES`` | positive integer \| `auto` | ``auto`` | ++----------------------------------+-----------------------------+------------------+ + +.. note:: This setting only applies to Nginx and has no effect for Apache. + +.. seealso:: https://nginx.org/en/docs/ngx_core_module.html#worker_processes + + +HTTPD_NGINX_WORKER_CONNECTIONS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Sets the maximum number of simultaneous connections that can be opened by a worker process. + +It should be kept in mind that this number includes all connections (e.g. connections with proxied +servers, among others), not only connections with clients. Another consideration is that the actual +number of simultaneous connections cannot exceed the current limit on the maximum number of open +files, which can be changed by worker_rlimit_nofile. + ++------------------------------------+-------------------+------------------+ +| Name | Allowed values | Default value | ++====================================+===================+==================+ +| ``HTTPD_NGINX_WORKER_CONNECTIONS`` | positive integer | ``1024`` | ++------------------------------------+-------------------+------------------+ + +.. note:: This setting only applies to Nginx and has no effect for Apache. + +.. seealso:: https://nginx.org/en/docs/ngx_core_module.html#worker_connections + MySQL ----- diff --git a/env-example b/env-example index 29d6df3d5..c2bc77689 100644 --- a/env-example +++ b/env-example @@ -561,6 +561,18 @@ HTTPD_TEMPLATE_DIR=.devilbox HTTPD_TIMEOUT_TO_PHP_FPM=180 +### +### NGINX ONLY +### +### Set worker_processes and worker_connections +### +### https://nginx.org/en/docs/ngx_core_module.html#worker_processes +### https://nginx.org/en/docs/ngx_core_module.html#worker_connections +### +HTTPD_NGINX_WORKER_PROCESSES=auto +HTTPD_NGINX_WORKER_CONNECTIONS=1024 + + ################################################################################ ### diff --git a/shell.bat b/shell.bat old mode 100755 new mode 100644