]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1406235 - Cleanup httpd config and expose server limits as env settings
authorDylan William Hardison <dylan@hardison.net>
Fri, 6 Oct 2017 16:28:33 +0000 (12:28 -0400)
committerGitHub <noreply@github.com>
Fri, 6 Oct 2017 16:28:33 +0000 (12:28 -0400)
Dockerfile
README.rst
httpd/httpd.conf

index ef226da56499f37fc27c52b5a4fe94351773a61e..604f12c14264a39963bb6de067c416788be51d11 100644 (file)
@@ -1,6 +1,11 @@
 FROM mozillabteam/bmo-slim:20170927.1
 
-ENV BUNDLE=https://s3.amazonaws.com/moz-devservices-bmocartons/bmo/vendor.tar.gz
+ENV HTTPD_StartServers=8
+ENV HTTPD_MinSpareServers=5
+ENV HTTPD_MaxSpareServers=20
+ENV HTTPD_ServerLimit=256
+ENV HTTPD_MaxClients=256
+ENV HTTPD_MaxRequestsPerChild=4000
 ENV PORT=8000
 
 WORKDIR /app
index a417de8105eed27eeead5bb28594ca2dcb348078..a3c731d163fc25a2f5992cab03d85138b7c58e3d 100644 (file)
@@ -73,7 +73,7 @@ After editing files in the bmo directory, you will need to run
 
     vagrant rsync && vagrant provision --provision-with update
 
-to see the changes applied to your vagrant VM. If the above command fails 
+to see the changes applied to your vagrant VM. If the above command fails
 or db is changed, do a full provision:
 
 .. code-block:: bash
@@ -171,6 +171,7 @@ Environmental Variables
 PORT
   This must be a value >= 1024. The httpd will listen on this port for incoming
   plain-text HTTP connections.
+  Default: 8000
 
 BMO_db_driver
   What SQL database to use. Default is mysql. List of supported databases can be
@@ -194,7 +195,7 @@ BMO_site_wide_secret
   This secret key is used by your installation for the creation and
   validation of encrypted tokens. These tokens are used to implement
   security features in Bugzilla, to protect against certain types of attacks.
-  It's very important that this key is kept secret. 
+  It's very important that this key is kept secret.
 
 BMO_inbound_proxies
   This is a list of IP addresses that we expect proxies to come from.
@@ -206,7 +207,7 @@ BMO_memcached_namespace
 
 BMO_memcached_servers
   A list of memcached servers (ip addresses or host names). Can be empty.
+
 BMO_shadowdb
   The database name of the read-only database.
 
@@ -220,6 +221,41 @@ BMO_apache_size_limit
   This is the max amount of unshared memory (in kb) that the apache process is
   allowed to use before Apache::SizeLimit kills it.
 
+HTTPD_StartServers
+  Sets the number of child server processes created on startup.
+  As the number of processes is dynamically controlled depending on the load,
+  there is usually little reason to adjust this parameter.
+  Default: 8
+
+HTTPD_MinSpareServers
+  Sets the desired minimum number of idle child server processes. An idle
+  process is one which is not handling a request. If there are fewer than
+  MinSpareServers idle, then the parent process creates new children at a
+  maximum rate of 1 per second.
+  Default: 5
+
+HTTPD_MaxSpareServers
+  Sets the desired maximum number of idle child server processes. An idle
+  process is one which is not handling a request. If there are more than
+  MaxSpareServers idle, then the parent process will kill off the excess
+  processes.
+  Default: 20
+
+HTTPD_MaxClients
+  Sets the maximum number of child processes that will be launched to serve requests.
+  Default: 256
+
+HTTPD_ServerLimit
+  Sets the maximum configured value for MaxClients for the lifetime of the
+  Apache process.
+  Default: 256
+
+HTTPD_MaxRequestsPerChild
+  Sets the limit on the number of requests that an individual child server
+  process will handle. After MaxRequestsPerChild requests, the child process
+  will die. If MaxRequestsPerChild is 0, then the process will never expire.
+  Default: 4000
+
 Persistent Data Volume
 ----------------------
 
index 472b734fcf11e62adcdd0311ba3a099097cec488..9df26b9db646c1a7c17d254bcbfb7720c18c0ec4 100644 (file)
@@ -1,60 +1,40 @@
+ServerName 127.0.0.1
 ServerTokens Prod
 ServerRoot "/etc/httpd"
+ServerAdmin root@localhost
+
 PidFile /tmp/httpd.pid
 Timeout 60
 KeepAlive Off
 MaxKeepAliveRequests 100
 KeepAliveTimeout 15
-<IfModule prefork.c>
-StartServers       8
-MinSpareServers    5
-MaxSpareServers   20
-ServerLimit      256
-MaxClients       256
-MaxRequestsPerChild  4000
-</IfModule>
-<IfModule worker.c>
-StartServers         4
-MaxClients         300
-MinSpareThreads     25
-MaxSpareThreads     75
-ThreadsPerChild     25
-MaxRequestsPerChild  0
-</IfModule>
+
+StartServers ${HTTPD_StartServers}
+MinSpareServers ${HTTPD_MinSpareServers}
+MaxSpareServers ${HTTPD_MaxSpareServers}
+ServerLimit ${HTTPD_ServerLimit}
+MaxClients ${HTTPD_MaxClients}
+MaxRequestsPerChild ${HTTPD_MaxRequestsPerChild}
+
 Listen ${PORT}
+User app
+Group app
+
 LoadModule authz_host_module modules/mod_authz_host.so
-LoadModule include_module modules/mod_include.so
 LoadModule log_config_module modules/mod_log_config.so
-LoadModule logio_module modules/mod_logio.so
 LoadModule env_module modules/mod_env.so
-LoadModule ext_filter_module modules/mod_ext_filter.so
 LoadModule mime_magic_module modules/mod_mime_magic.so
 LoadModule expires_module modules/mod_expires.so
 LoadModule deflate_module modules/mod_deflate.so
 LoadModule headers_module modules/mod_headers.so
-LoadModule usertrack_module modules/mod_usertrack.so
 LoadModule setenvif_module modules/mod_setenvif.so
 LoadModule mime_module modules/mod_mime.so
-LoadModule dav_module modules/mod_dav.so
-LoadModule status_module modules/mod_status.so
-LoadModule autoindex_module modules/mod_autoindex.so
-LoadModule info_module modules/mod_info.so
-LoadModule dav_fs_module modules/mod_dav_fs.so
-LoadModule vhost_alias_module modules/mod_vhost_alias.so
 LoadModule negotiation_module modules/mod_negotiation.so
 LoadModule dir_module modules/mod_dir.so
-LoadModule actions_module modules/mod_actions.so
-LoadModule speling_module modules/mod_speling.so
 LoadModule alias_module modules/mod_alias.so
-LoadModule substitute_module modules/mod_substitute.so
 LoadModule rewrite_module modules/mod_rewrite.so
-LoadModule cache_module modules/mod_cache.so
-LoadModule disk_cache_module modules/mod_disk_cache.so
-LoadModule version_module modules/mod_version.so
 LoadModule perl_module modules/mod_perl.so
-User app
-Group app
-ServerAdmin root@localhost
+
 UseCanonicalName Off
 <Directory />
     Options FollowSymLinks
@@ -68,9 +48,7 @@ AccessFileName .htaccess
 </Files>
 TypesConfig /etc/mime.types
 DefaultType text/plain
-<IfModule mod_mime_magic.c>
-    MIMEMagicFile conf/magic
-</IfModule>
+MIMEMagicFile conf/magic
 HostnameLookups Off
 ErrorLog /dev/stderr
 LogLevel warn
@@ -80,10 +58,6 @@ LogFormat "%{Referer}i -> %U" referer
 LogFormat "%{User-agent}i" agent
 ServerSignature Off
 AddDefaultCharset UTF-8
-AddType application/x-compress .Z
-AddType application/x-gzip .gz .tgz
-AddType application/x-x509-ca-cert .crt
-AddType application/x-pkcs7-crl    .crl
 
 PerlSwitches -wT
 PerlRequire /app/mod_perl.pl