0

I am running into traffic issues as apache 2.4.18 maxes out on concurrent connections:

 ps auxf | grep apache2 | wc -l
 258

As soon as 258 is reached the server is waiting to serve new connections to new visitors, the value never rises above 258.

My config looks like this:

sudo nano /etc/apache2/mods-available/mpm_worker.conf 

<IfModule mpm_worker_module>
        ServerLimit             1000
        StartServers                     4
        MinSpareThreads          25
        MaxSpareThreads          75
        ThreadLimit                      64
        ThreadsPerChild          25
        MaxRequestWorkers         1000
        MaxConnectionsPerChild   1000
</IfModule>

$ top

top - 22:00:11 up 18 days,  5:19,  1 user,  load average: 0.70, 0.58, 0.56
Tasks: 491 total,   1 running, 490 sleeping,   0 stopped,   0 zombie
%Cpu(s): 14.2 us,  0.7 sy,  0.0 ni, 85.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 32771980 total,  3880728 free,  5584288 used, 23306964 buff/cache
KiB Swap:  4194300 total,  4179024 free,    15276 used. 26069740 avail Mem 

I thought this setup would provide 1000 connections. How can I increase the amount of connections possible?

merlin
  • 2,033
  • 11
  • 37
  • 72
  • I suspect you are not using mpm_worker – davidgo May 19 '20 at 20:07
  • How could I verify this? – merlin May 19 '20 at 20:10
  • apachectl -M | grep "mpm" would show what mpm modules are loaded. If mpm_worker_module does not appear that would explain it. – davidgo May 19 '20 at 21:41
  • here is a good hint: $ sudo apachectl -M | grep "mpm" AH00180: WARNING: MaxRequestWorkers of 1000 exceeds ServerLimit value of 256 servers, decreasing MaxRequestWorkers to 256. To increase, please see the ServerLimit directive. mpm_prefork_module (shared) – merlin May 20 '20 at 04:52
  • No server limit seems specified: grep ServerLimit /etc/apache2/apache2.conf brings no results. – merlin May 20 '20 at 05:01
  • So there is your answer - you are using mpm_prefork - the config for this is likely not in apache2.conf - on the (Ubuntu) server I checked it was in /etc/apache2/mods-available/mpm_prefork.conf. It sounds like you need to add the ServerLimit directive for that module. – davidgo May 20 '20 at 05:50
  • is this not the case already? Have a look into the question. ServerLimit is defined as first line. – merlin May 20 '20 at 10:43
  • But its in an IfModule stanza, and nothing you have said confirms the mpm_worker module is being loaded - indeed the evidence is you are NOT using worker, you are using prefork. – davidgo May 20 '20 at 10:55
  • Great! Thank you. I overlooked the slight difference in naming. Added the ServerLimit = 1000 to to npm_prefork.conf and restarted apache. Let's see if this will remove the top line of 258. The error msg is gone now. – merlin May 20 '20 at 12:14
  • Aparently the problem is not solved. I have increase the server limit to 1000, but the amount of processes is still limited to 258. – merlin May 24 '20 at 16:29

0 Answers0