C’est peut-être un peu ambitieux de permettre 150 serveurs, chacun occupant minimum 60MB
$ ubuntu@website:~/Website$ sudo docker-compose exec php-apache bash
$ cat /etc/apache2/mods-enabled/mpm_prefork.conf
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Je tente de réduire à 15.
$ cat npm_prefork.conf
...
MaxRequestWorkers 15
...
$ cat docker-compose.yml
...
- ./mpm_prefork.conf:/etc/apache2/mods-enabled/mpm_prefork.conf
...
$ top
Tasks: 166 total, 1 running, 165 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.7 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3947984 total, 1167156 free, 1789732 used, 991096 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 1800980 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4696 999 20 0 1324628 496896 12892 S 0.0 12.6 1:23.82 mysqld
5711 www-data 20 0 395512 158512 14080 S 0.0 4.0 4:25.18 apache2
5714 www-data 20 0 395300 158300 14084 S 0.0 4.0 5:13.44 apache2
11412 www-data 20 0 395256 157996 13772 S 0.0 4.0 2:05.82 apache2
5171 www-data 20 0 395624 157808 13772 S 0.0 4.0 4:39.52 apache2
5167 www-data 20 0 385036 146820 13768 S 0.0 3.7 4:46.39 apache2
5715 www-data 20 0 341236 104808 14392 S 0.0 2.7 4:47.88 apache2
5170 www-data 20 0 330760 94016 14084 S 0.0 2.4 4:26.45 apache2
5168 www-data 20 0 330504 93748 14084 S 0.0 2.4 4:54.54 apache2
5169 www-data 20 0 327416 90668 14084 S 0.0 2.3 4:36.84 apache2
10716 www-data 20 0 327424 90360 13772 S 0.0 2.3 2:57.47 apache2
3148 uuidd 20 0 158560 57060 4848 S 0.0 1.4 0:01.06 /usr/sbin/amavi
3150 uuidd 20 0 160088 56600 4388 S 0.0 1.4 0:00.00 /usr/sbin/amavi
3151 uuidd 20 0 160088 56600 4388 S 0.0 1.4 0:00.00 /usr/sbin/amavi
Pour l’instant tout va bien.
Tasks: 171 total, 2 running, 169 sleeping, 0 stopped, 0 zombie
%Cpu(s): 89.7 us, 10.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3947984 total, 406128 free, 1958492 used, 1583364 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 1616040 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4696 999 20 0 1327228 499400 12596 S 1.8 12.6 4:13.90 mysqld
5711 www-data 20 0 396032 159036 14080 S 0.0 4.0 15:01.51 apache2
11412 www-data 20 0 395856 158688 13772 S 0.0 4.0 12:02.27 apache2
5714 www-data 20 0 395300 158416 14144 S 0.0 4.0 15:35.73 apache2
17626 www-data 20 0 395304 158064 13772 S 0.0 4.0 9:41.95 apache2
5167 www-data 20 0 395224 157840 13772 S 0.0 4.0 15:29.77 apache2
5168 www-data 20 0 390924 152396 14084 R 97.6 3.9 15:23.52 apache2
31265 www-data 20 0 376532 139468 13772 S 0.0 3.5 2:40.70 apache2
17668 www-data 20 0 371972 135052 13896 S 0.0 3.4 9:44.54 apache2
17628 www-data 20 0 341232 104500 14088 S 0.0 2.6 10:17.78 apache2
31267 www-data 20 0 328440 91388 13772 S 0.0 2.3 2:39.49 apache2
5145 uuidd 20 0 158608 57212 5012 S 0.0 1.4 0:00.10 /usr/sbin/amavi
Pour l’instant tout va bien. Je met un rappel de vérifier que ça continue a aller bien dans une semaine. Je suis assez confiant sur ce coup: c’est pas la première fois que cette limite de 150 serveurs simultanés (!) crée de légers problèmes de mémoire (mais sur d’autres machines). J’aurais du penser a vérifier.
Tasks: 168 total, 2 running, 166 sleeping, 0 stopped, 0 zombie
%Cpu(s): 63.5 us, 4.7 sy, 0.0 ni, 31.2 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3947984 total, 415136 free, 1965520 used, 1567328 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 1609572 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4696 999 20 0 1327228 495168 7392 S 1.0 12.5 9:51.27 mysqld
5167 www-data 20 0 395992 158268 13304 S 0.0 4.0 44:21.34 apache2
11412 www-data 20 0 395856 157916 13000 R 22.9 4.0 41:11.04 apache2
5711 www-data 20 0 395528 157712 13320 S 0.0 4.0 44:01.03 apache2
5714 www-data 20 0 395556 157640 13164 S 0.0 4.0 44:36.82 apache2
31267 www-data 20 0 395316 157012 13024 S 7.3 4.0 32:25.13 apache2
6443 www-data 20 0 384896 145916 13000 S 0.0 3.7 29:17.76 apache2
31265 www-data 20 0 377308 139796 13304 S 0.0 3.5 31:59.15 apache2
6445 www-data 20 0 373996 136212 13036 S 35.9 3.5 28:49.73 apache2
2412 www-data 20 0 339592 102436 13680 S 0.0 2.6 13:51.98 apache2
2411 www-data 20 0 339328 102176 13688 S 0.0 2.6 13:43.45 apache2
32000 uuidd 20 0 158608 57060 4868 S 0.0 1.4 0:00.87 /usr/sbin/amavi
32003 uuidd 20 0 160136 56484 4292 S 0.0 1.4 0:00.00 /usr/sbin/amavi
Toujours stable.