Apache shutting down in every 10 to 20 minutes

I don't know why, apache2 shutting down in every 10 to 20 minutes?
Got this error from apache2:
AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

Please suggest me a better solution, my concurrent users is about 120

Configurations:
OS : Ubuntu 18.04.2 LTS
RAM : 2GB
MPM : prefork
Server: Apache/2.4.29

5 Replies

The MaxRequestWorkers setting depends on your particular setup, but we have a guide on tuning Apache that may help. In addition, there's a took called Apache2Buddy that can recommend optimal settings for your Linode.

Open apache2.conf - what are the settings under mpm_worker_module?

@Lakshitatrank

I have already mentioned that I'm using mpm_prefork and configuration is as default:

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>

Basically, there is nobody who has a solution to this problem?

For Apache2, mpm_event, mpm_prefork and mpm_worker are all included (but not enabled) by default, unless you've removed them:

#Modules your Apache has loaded at runtime:
$ apache2ctl -M

It is generally not recommended to run threaded MPM in production with Apache2. You can convert apache to event or worker using a2enmod:

#Lists modules
$ ls -la /etc/apache2/mods-available

#Shows the current MPM:
$ apachectl -V | grep -i mpm

#Disables prefork and enables event
$ a2dismod mpm_prefork && a2enmod mpm_event
$ sudo service apache2 restart

#Disables prefork and enables worker
$ a2dismod mpm_prefork && a2enmod mpm_worker
$ sudo service apache2 restart

#Disables event and enables worker
$ a2dismod mpm_event && a2enmod mpm_worker
$ sudo service apache2 restart

The helpful guide on Tuning Your Apache Server Mike offered has very helpful step-by-step instructions on adjusting your Max Request Workers to help address this issue.

Feel free to let us know what the outcomes of using that guide were. We are happy to help if you run into difficulty!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct