trg
By:
trg

Apache crashing linked to MaxRequestWorkers?

August 4, 2015 13.2k views
Apache

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!

[Mon Aug 03 15:00:52.167824 2015] [core:warn] [pid 3045] AH00045: child process 3651 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.167944 2015] [core:warn] [pid 3045] AH00045: child process 3664 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.167956 2015] [core:warn] [pid 3045] AH00045: child process 3690 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.167972 2015] [core:warn] [pid 3045] AH00045: child process 3666 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.168029 2015] [core:warn] [pid 3045] AH00045: child process 3672 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.168046 2015] [core:warn] [pid 3045] AH00045: child process 3673 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.168379 2015] [core:warn] [pid 3045] AH00045: child process 3711 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234635 2015] [core:warn] [pid 3045] AH00045: child process 3486 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234705 2015] [core:warn] [pid 3045] AH00045: child process 3595 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234723 2015] [core:warn] [pid 3045] AH00045: child process 3610 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234737 2015] [core:warn] [pid 3045] AH00045: child process 3616 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234750 2015] [core:warn] [pid 3045] AH00045: child process 3619 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234762 2015] [core:warn] [pid 3045] AH00045: child process 3632 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234773 2015] [core:warn] [pid 3045] AH00045: child process 3635 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234786 2015] [core:warn] [pid 3045] AH00045: child process 3651 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234799 2015] [core:warn] [pid 3045] AH00045: child process 3664 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234861 2015] [core:warn] [pid 3045] AH00045: child process 3690 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234874 2015] [core:warn] [pid 3045] AH00045: child process 3666 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234899 2015] [core:warn] [pid 3045] AH00045: child process 3672 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234917 2015] [core:warn] [pid 3045] AH00045: child process 3673 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.234929 2015] [core:warn] [pid 3045] AH00045: child process 3711 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497612 2015] [core:warn] [pid 3045] AH00045: child process 3616 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497688 2015] [core:warn] [pid 3045] AH00045: child process 3619 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497723 2015] [core:warn] [pid 3045] AH00045: child process 3635 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497743 2015] [core:warn] [pid 3045] AH00045: child process 3651 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497786 2015] [core:warn] [pid 3045] AH00045: child process 3666 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497804 2015] [core:warn] [pid 3045] AH00045: child process 3672 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497818 2015] [core:warn] [pid 3045] AH00045: child process 3673 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:52.497831 2015] [core:warn] [pid 3045] AH00045: child process 3711 still did not exit, sending a SIGTERM
[Mon Aug 03 15:00:53.500161 2015] [mpm_prefork:notice] [pid 3045] AH00169: caught SIGTERM, shutting down
[Mon Aug 03 15:01:05.467881 2015] [mpm_prefork:notice] [pid 1001] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.7 configured -- resuming normal operations
[Mon Aug 03 15:01:05.474812 2015] [core:notice] [pid 1001] AH00094: Command line: '/usr/sbin/apache2'
[Mon Aug 03 15:02:32.958854 2015] [mpm_prefork:error] [pid 1001] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
2 comments
  • 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

3 Answers

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,were you able to fixed it?im currently having the same problem,have tried tuning apache but still the error still occurs and crashes apache. i would appreciate any help.

  • 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

    Sorry I couldn't help.

I was able to fix it by issuing an upgrade command

apt-get update && apt-get upgrade -y
Have another answer? Share your knowledge.