WordPress keep crashing on your Lightsail instance?
November 10, 2025This post doesn’t really have to do with college basketball analytics, but I had to troubleshoot this for this site and figured that someone else might be able to benefit from what I found and how I (hopefully) fixed the issue.
This site is hosted on a AWS Lightsail instance, running the bitnami stack. It is a minimal instance – 1 GB of RAM, two well-intentioned, but performance-impaired CPUs, and 40GB of storage. When I added the ~12Mb game calendar model prediction page, I unknowingly put a big load on the server. The symptoms were that the site would just go down after several hours. If I rebooted, it would work fine for a while, then mysteriously disappear.
I ran “top” in a terminal window while I clicked around on various links on the site. I noticed that the “httpd.bin” processes were just growing in memory usage and never releasing the memory back to the system, even after being idle for minutes/hours. Eventually, the httpd.bin processes grew so large that they could no longer fit in system memory and the system started to swap. Then, it would thrash for a bit and eventually go belly up.
So, I immediately tried to set a lifetime on the httpd.bin processes, so that after reaching some threshold, the process would die off, Logan’s Run style, and a new, fresh one could take its place. Such parameters do exist, but (to me, anyway), they seem to lack intuitive documentation. Adding to the complexity is the fact that the bitnami stack is a little bit unique – the main apache2 install is in /opt/bitnami/apache2, but the configuration consists of three different conf files (see the Include directives at the bottom of the first config file):
/opt/bitnami/apache2/conf/httpd.conf
/opt/bitnami/apache2/conf/bitnami/bitnami.conf
/opt/bitnami/apache2/conf/bitnami/httpd.conf
So, the first thing I did was to add the mpm_event_module module parameter section to the main config file. At the bottom of /opt/bitnami/apache2/conf/httpd.conf, I added:
# event MPM
# StartServers: initial number of server processes to start
# 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
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_event_module>
ServerLimit 2
#StartServers 3
StartServers 1
#MinSpareThreads 75
MinSpareThreads 25
#MaxSpareThreads 250
MaxSpareThreads 75
ThreadsPerChild 25
#MaxRequestWorkers 400
MaxRequestWorkers 50
#MaxConnectionsPerChild 0
MaxConnectionsPerChild 100
</IfModule>
I commented out the default settings and tried to drop the number of resources available to apache and the httpd.bin processes. I googled as much as I could to come up with some reasonable parameters. I started very conservative – only letting apache have minimal servers, workers, children, threads, etc. This was good since I could see it was working – I watched the httpd.bin process sizes in memory as I clicked around on the site and they weren’t growing past 8% memory usage. This was great! I thought I had solved the problem. Then, the next day, I found that the site was down. The server itself was up, but the site was down. Digging around a little, I found the following error messages in the apache log (/opt/bitnami/apache2/conf/error_log):
[Sun Nov 09 20:36:48.195777 2025] [mpm_event:error] [pid 27787:tid 139832091834112] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Sun Nov 09 20:40:05.396753 2025] [mpm_event:error] [pid 27787:tid 139832091834112] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Sun Nov 09 20:46:00.735188 2025] [mpm_event:error] [pid 27787:tid 139832091834112] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Sun Nov 09 20:50:08.987163 2025] [mpm_event:error] [pid 27787:tid 139832091834112] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
Stuck again. I succeeded in keeping the httpd.bin processes from crashing the site, but I somehow hamstrung apache to the point that it couldn’t serve any more pages. So, I created a pretty detailed prompt of everything I had seen and tried and asked ChatGPT. ChatGPT recommended that I turn off ModPagespeed. So, I edited /opt/bitnami/apache2/conf/pagespeed.conf and changed “ModPagespeed on” to “ModPagespeed off”. Then, I changed the apache2 event mpm parameters to the following:
<IfModule mpm_event_module>
ServerLimit 2
StartServers 1
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestWorkers 50
MaxConnectionsPerChild 100
</IfModule>
Then, sudo /opt/bitnami/ctlscript.sh restart apache
And…it seems stable! Fingers crossed. If things go haywire and I have to go in and tweak, I will update here.
