I am curious how Apache handles how memory is allocated to each of the processes that it creates. I am currently running a Debian server.
Right now my server has 8GB of memory and has been on for about 7 days right now. Right now it shows that my server has about 50MB of available memory.
When I run "top -u www-data" I see all the Apache processes that are currently running. In the VIRT column I am seeing that each process is at 354m and the RES column varies between 9254 and 60m.
What I find odd is that when I restart Apache, the process IDs do change, but they automatically go right back to taking up about the same amount of memory.
Basically my concern is that Apache is taking up too much memory. Right now I have MaxKeepAliveRequests set to 100 and KeepAliveTimeout set to 3. I also have the following directives set:
<IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 200 </IfModule> <IfModule mpm_worker_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule>
Now when I access the server, I do not really see any performance issues. The load average generally stays very long, I just seem to be having pretty low amount of available memory. It is not going to swap hardly at all (760k is the highest I have seen it).
I just seem to be worrying that Apache is taking too much memory. If this is normal and it will not cause the server to kill itself, I can learn to live with this. It just does not seem right.
Any input would be greatly appreciated. Thanks