I read about the Apache mpm-prefork
configuration and I tried to tune the MaxRequestWorkers
parameter.
My settings before the change were as follows:
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 64
ServerLimit 512
MaxRequestWorkers 500
MaxConnectionsPerChild 0
</IfModule>
Then, because of increasing the concurrent users in my app, I decided to increase the MaxRequestWorkers
from 500 to 670 and also ServerLimit
from 512 to 700.
Fortunately, the problem of slow connection was solved using these changes. But considering the reports from Apache2buddy
, the average process memory is 16MB which means apache potentially needs at least 670*16 ~= 10GB
of RAM. While my server has only 4GB of RAM.
Now, using htop
the usage of RAM is about 2.3GB and 400MB swap (from 1GB available)
- Why apache does not use more memory actually?
- What is the best config in my case? (using about 600 process count)
- Does my config has some bad consequences?
So what