changeset 412:731107a67700

Try to optimise PHP settings We occasionally lock up, seemingly because PHP ends up with too many open connections or insufficient memory. Scale the PHP and Apache settings appropriately and time out connections sooner.
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Oct 2022 12:17:24 +0100
parents 83f2e944a43f
children 6421c6f77eb8
files modules/website/files/php.conf modules/website/files/zzz-0-custom.conf
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/website/files/php.conf	Sat Oct 08 12:15:52 2022 +0100
+++ b/modules/website/files/php.conf	Sat Oct 08 12:17:24 2022 +0100
@@ -4,7 +4,7 @@
 <Files ".user.ini">
 	Require all denied
 </Files>
-<Proxy "fcgi://localhost/" enablereuse=on max=50 timeout=300>
+<Proxy "fcgi://localhost/" enablereuse=on max=50 smax=25 ttl=60>
 </Proxy>
 <FilesMatch "\.php$">
 	# Don't wrap in an <IfModule> because we'd rather it failed
--- a/modules/website/files/zzz-0-custom.conf	Sat Oct 08 12:15:52 2022 +0100
+++ b/modules/website/files/zzz-0-custom.conf	Sat Oct 08 12:17:24 2022 +0100
@@ -1,3 +1,12 @@
+<IfModule mpm_event_module>
+  StartServers 1
+  ServerLimit 2
+  ThreadsPerChild 64
+  MaxRequestWorkers 128
+  MinSpareThreads 10
+  MaxSpareThreads 50
+</IfModule>
+
 SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
 SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
 SSLHonorCipherOrder     off