Question

Apache crashing linked to MaxRequestWorkers?

Hi. I’m wondering if someone can help me solve a problem with my Ubuntu 14.04 server running Apache, PHP, MySQL and phpmyadmin. On the webserver, I’m running an IPB 3.4 forum. It had perfect uptime for around 5 months with no issues until a few days ago when Apache crashed unexpectedly. On every restart, apache will work for a few minutes, then crash with the same message.

The error log tells me to raise MaxRequestWorkers setting, but I changed it and the error still persists. I edited it via “/etc/apache2/mods-enabled/mpm_prefork.conf”, is that the correct place to do so, or is there a different place to edit it?

Any assistance on this issue would be great, I’ll put the last few lines of the Apache error log at the end of this post. Thank you!

Leave a comment

It seems, it is not just the MaxRequestWorkers but also related to overall load on the server. What is the constant load (max. no. of concurrent connection) right now on the server?

In my experience, you can easily achieve 50-60 concurrent users on a 1GB droplet. It depends on how you have configured your server but if you exceed this load, may be you need a higher VPS or some different configurations!

Did you get anywhere with this? I have a very similar problem. Exactly the same entry in the logs which randomly occurs and eventually causes the server to crash. the crash mechanism appears to be that

8967 apache 562.95 MB /usr/sbin/httpd

Spawns Multiple processes and when it gets to about 120 /usr/sbin/httpd processes running then I run out of memory and it crashes

Apache version 2.4.16
MySQL version 5.5.45
PHP/5.4.45

All running on a Amazon AWS specific version of Linux. Running a generously specified Amazon instance

These answers are provided by our Community. If you find them useful, show some love by clicking the heart.
If you run into issues leave a comment, or add your own answer to help others.

The error message you’re seeing could be a symptom, not the problem. If PHP isn’t able to handle the requests as fast as they are coming in (for example, if you have slowness in your PHP scripts or bugs in the code causing PHP requests to hang for a long time), then the number of concurrent requests being handled by Apache can build up and ultimately cause MaxRequestWorkers to be exceeded. If this is happening, then any setting for MaxRequestWorkers won’t fix it. Instead, you need to figure out the root of the problem as to why PHP can’t keep up with requests. How to go about debugging that will depend on whether you have PHP configured through mod_php or PHP-FPM.

Hi, I tried everything I could think of and nothing worked so I just ended up installing my database and ftp on a new host (not DigitalOcean) and haven’t had any problems since…

Everything from restoring backups with current SQL DB, to old DB and it kept occuring on all my droplets. Made fresh droplets with clean installs. New databases. Nothing would work. Must be a glitch with DO, I was stumped, and still am. Haha