1

I would like to change the default max connection numbers in Apache as the number of processes is now

# ps -ef | grep apache2 | wc -l
152

I have read that I have to change ServerLimit, but I don't see that in apache config files.

# grep -r ServerLimit .
#

Where should I apply that?

UPDATE:

Regarding the MPM module, I see this in mods-available/mpm_prefork.conf:

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

Should I increase MaxRequestWorkers only? Or I have to define ServerLimit?

mahmood
  • 23,197
  • 49
  • 147
  • 242

1 Answers1

1

MPM configuration setting located in conf.modules.d/00-mpm.conf file. You can configure ServerLimit after LoadModule entry. You can refer httpd process always 256

Pandurang
  • 1,656
  • 2
  • 6
  • 10
  • The ServerLimit directive represents the upper limit of MaxRequestWorkers. You need to specify ServerLimit value. – Pandurang Jul 08 '20 at 07:35
  • So, if I set `MaxRequestWorkers` to 400, Is it fine to set `ServerLimit` to 600? – mahmood Jul 08 '20 at 07:38
  • In the link you mentioned `ServerLimit` is less than `MaxRequestWorkers` – mahmood Jul 08 '20 at 07:38
  • Moreover, the output of `Server MPM:` from `apache2 -V` is empty. – mahmood Jul 08 '20 at 07:40
  • For best practices, `ServerLimit and MaxRequestWorkers` should be the same. – Pandurang Jul 08 '20 at 07:43
  • I ran `apache2buddy.pl` before change and hot `Your ServerLimit setting is 256` which is the default and `Your MaxRequestWorkers setting is 150`. Then I only changed those parameters to 500 without including any .so file. Again, I run the script and see `[ -- ] Your ServerLimit setting is 500` and `[ -- ] Your MaxRequestWorkers setting is 500`. – mahmood Jul 08 '20 at 08:19
  • As I checked the number of apache2 processes, it is now 202 instead of 152 (before) which I think it is working fine. Thanks for the help. – mahmood Jul 08 '20 at 08:20