The settings for apache MPM workers are written to /etc/apache2/conf-available/000mpm-worker.conf by u-r-c. However, these don't take effect, because they are set already in
/etc/apache2/mods-available/mpm-worker.conf, and apparently, first match takes precedence.
This means that the u-r-c apache2 can run into these errors:
[Thu Dec 06 03:24:54.774311 2018] [mpm_worker:error] [pid 86272:tid 139974961301376] AH00288: scoreboard is full, not at MaxRequestWorkers
Workaround:
- update charm settings (in my case, I ran "juju config ubuntu-repository-cache apache2_mpm_maxrequestworkers=8192 apache2_mpm_serverlimit=128")
- wait for settings to apply
- on the unit: cd /etc/apache2; sudo cp conf-available/000mpm-worker.conf mods-available/mpm_worker.conf
- sudo service apache2 restart
I can confirm this as seen today:
| $ juju config ubuntu- repository- cache | grep apache2_mpm -A1 mpm_maxconnecti onsperchild: mpm_maxrequestw orkers: mpm_maxsparethr eads: mpm_minsparethr eads: mpm_serverlimit : mpm_startserver s: mpm_threadlimit : mpm_threadsperc hild:
| apache2_
| default: 0
| --
| apache2_
| default: 8192
| --
| apache2_
| default: 100
| --
| apache2_
| default: 50
| --
| apache2_
| default: 512
| --
| apache2_
| default: 2
| --
| apache2_
| default: 64
| --
| apache2_
| default: 64
| --
| apache2_mpm_type:
| default: worker
But yet, the written out config contains the defaults:
| ubuntu@machine-0:~$ cat /etc/apache2/ conf-enabled/ 000mpm- worker. conf hild: maximum number of requests a server process serves erChild 0
| #
| # JUJU WARNING: This file is managed by Juju, do NOT edit
| #
|
| # worker MPM
| # StartServers: initial number of server processes to start
| # MaxClients: maximum number of simultaneous client connections
| # MinSpareThreads: minimum number of worker threads which are kept spare
| # MaxSpareThreads: maximum number of worker threads which are kept spare
| # ThreadsPerChild: constant number of worker threads in each server process
| # MaxRequestsPerC
| <IfModule mpm_worker_module>
| StartServers 2
| MinSpareThreads 50
| MaxSpareThreads 100
| ThreadLimit 64
| ThreadsPerChild 64
| ServerLimit 5
| MaxRequestWorkers 256
| MaxConnectionsP
| </IfModule>
It is only when you juju config/set does these values change:
| $ juju config ubuntu- repository- cache apache2_ mpm_maxrequestw orkers= 16384 apache2_ mpm_serverlimit =256 apache2_ mpm_maxsparethr eads=200 apache2_ mpm_minsparethr eads=100
So now:
| ubuntu@machine-0:~$ cat /etc/apache2/ conf-enabled/ 000mpm- worker. conf hild: maximum number of requests a server process serves erChild 0
| #
| # JUJU WARNING: This file is managed by Juju, do NOT edit
| #
|
| # worker MPM
| # StartServers: initial number of server processes to start
| # MaxClients: maximum number of simultaneous client connections
| # MinSpareThreads: minimum number of worker threads which are kept spare
| # MaxSpareThreads: maximum number of worker threads which are kept spare
| # ThreadsPerChild: constant number of worker threads in each server process
| # MaxRequestsPerC
| <IfModule mpm_worker_module>
| StartServers 2
| MinSpareThreads 100
| MaxSpareThreads 200
| ThreadLimit 64
| ThreadsPerChild 64
| ServerLimit 256
| MaxRequestWorkers 16384
| MaxConnectionsP
| </IfModule>