Whats the frequency of the letter s in:
Q: How to optimize prefork mpm for high traffic? I have allocated 5GB of memory for Apache processes.
While basing on the fact that each Apache process consume in average 42.5MB Ive set the following on my server (while calculating as if each process consumes 50MB of memory):
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          100
    MaxRequestsPerChild   0
</IfModule>

Now for the questions:


*

*How can I determine how much StartServers to set?

*While not being able to set Worker mpm (PHP etc.), does load balancing is my best option for high traffic?

*How can I reduce Apache process memory? my website use CDN to serve assets to the user while the server eventually serve HTML only.


Ive read answers here and searched a lot in Google for that questions and couldnt find anything specific enough.

A: Beware: most apache process shares most of its memory with its parents/siblings. You cant easily sum the values of the from apache processes allocated memory. The best what you can do: you start a lot of apache processes and check how this change your allocated memory.
1: StartServers has only a limited importance. It means, how many child process will be started initially. Min/MaxSpareServers are much more important.
2: I cant understand, you didnt said anything your load balancing solution. If you want to be able to handle high traffic, your best option were to use a worker apache (or even an other type of http server) for static file serving, and a prefork-based (I suggest you mpm-itk) for dynamic languages (probably for php). The worker should forward the dynamic requests to the prefork-based server. This structure is also capable to be easily extended to a load-balanced cluster solution.
3: MayRequestPerChild==0 means, that the processes wont ever restarted. Thus if there is a problem with them, it werent ever fixed, or if they are leaking, this also wont be solved. It can be ok if your system is rock-stable, and you are using only perfect garbage collected languages on the server side (php isnt one of them!), but I think, from practical reasons it is better to use a big integer value (in most cases I use 100 or 500). Beware: a simple child process restart isnt really costly compared to its handling of 100-500 requests.

user
There are 148 "s"s.
assistant