I'm unable to determine, how many users my apache instance can handle.
I installed Apache 2.4.18 from Ubuntu repository, as far as I remember, all settings are default ones.
I did a server stress test and discovered, that when exceeding 300 ongoing requests, server start to drop new ones, serving response code 502 or 504.
I tried to find an explanation for that in server configuration file and documentation, but I was unable to discover where that "300" came from.
I'm using mpm_prefork
, with config file like this:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>
Some of the properites from apache2.conf
:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 5
So the question is what is Apache DEFAULT max concurrent clients limit in my (default) configuration? I'm not interested in tuning Apache to handle as many connections as possible – only to understand, how Apache calculates max concurrent clients limit.
Best Answer
Per the Apache documentation,
Depending on your available RAM, the default settings are often too high.
To determine the correct setting, look at your average Apache process size to get usage x MB. Consider how much memory you want to keep available for other processes y MB and use this formula for prefork.
NOTE: the "y" value will always be at least 500 MB just for Apache itself and the operating system, and may well need to be more depending on other applications.
As to the other values, the Apache documentation repeatedly advises against raising these values except "on very busy sites," of which by definition a site having, for example, only 2-4 GB total RAM will never be. The following will be good:
For additional reference, you can look at the Apache Documentation for performance tuning this issue.