apache: add customization of MPM
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sun, 11 Sep 2016 22:26:05 +0000 (00:26 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 12 Sep 2016 21:13:44 +0000 (23:13 +0200)
MPM can be selected between event, prefork or worker
Set worker as the default one as it was before even if event MPM is
better on system supporting thread safe polling

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/apache/Config.in
package/apache/apache.mk

index 0814a17f7e413edeca21f310a9a84055523d3963..511876d2eb87acb5452c97efa93e693742f5852b 100644 (file)
@@ -14,6 +14,34 @@ config BR2_PACKAGE_APACHE
 
          http://httpd.apache.org
 
+if BR2_PACKAGE_APACHE
+
+choice
+       prompt "Multi-Processing Module (MPM)"
+       default BR2_PACKAGE_APACHE_MPM_WORKER
+       help
+         Select the Multi-Processing Module (MPM).
+
+config BR2_PACKAGE_APACHE_MPM_EVENT
+       bool "event"
+       help
+         A variant of the worker MPM with the goal of consuming threads
+         only for connections with active processing
+
+config BR2_PACKAGE_APACHE_MPM_PREFORK
+       bool "prefork"
+       help
+         Implements a non-threaded, pre-forking web server
+
+config BR2_PACKAGE_APACHE_MPM_WORKER
+       bool "worker"
+       help
+         Implements a hybrid multi-threaded multi-process web server
+
+endchoice
+
+endif
+
 comment "apache needs a toolchain w/ dynamic library, threads"
        depends on BR2_USE_MMU
        depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
index e78545a076ae38d3c56aa5c50580b2eb7ba29b95..e54b73609090f46ed16df9a4ec5efd1bd0b3cb9b 100644 (file)
@@ -20,6 +20,14 @@ APACHE_CONF_ENV= \
        ap_cv_void_ptr_lt_long=no \
        PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre-config
 
+ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT),y)
+APACHE_MPM = event
+else ifeq ($(BR2_PACKAGE_APACHE_MPM_PREFORK),y)
+APACHE_MPM = prefork
+else ifeq ($(BR2_PACKAGE_APACHE_MPM_WORKER),y)
+APACHE_MPM = worker
+endif
+
 APACHE_CONF_OPTS = \
        --sysconfdir=/etc/apache2 \
        --with-apr=$(STAGING_DIR)/usr \
@@ -31,7 +39,7 @@ APACHE_CONF_OPTS = \
        --enable-mime-magic \
        --without-suexec-bin \
        --enable-mods-shared=all \
-       --with-mpm=worker \
+       --with-mpm=$(APACHE_MPM) \
        --disable-lua \
        --disable-luajit