httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject Re: [users@httpd] MPM Worker settings calculation
Date Wed, 21 Nov 2012 10:21:25 GMT
On Wed, Nov 21, 2012 at 9:44 AM, rewt rewt <> wrote:
> Hello,
> After many performances issues with mpm prefork (high memory) i would like
> to use the MPM worker wich seems better for high traffic sites.
> I have been able to estimate the RAM per httpd process in prefork around
> 25m.
> With the prefork setting i have calculate MaxClients this way:
> MaxClients = ((TOTAL_MEMORY -
> It means that for a 8GB RAM server using arround 25M for each connections
> with a system usage of around 1,5G i will have:
> MaxClients=((8000000 - 2000000)/25000)-10%
> MaxClients=216 (arround 220)
> Correct, right ?
> But now i want to use MPM worker (with FastCGI for PHP, APC and
> mod_mem_cache (if it is possible ?)).
> My issue is that i don't know how to calculate the settings for MaxClients,
> ThreadPerChild, ThreadStackSize etc...
> And the documentation even on the Apache site is not explained anywhere (as
> far as i have seen)
> I am using a VPS with 32Gb of RAM and 8 vCPU. (i d like to use haproxy as a
> reverse proxy with 2 or 3 VPS like that in the backend)
> The PHP app is using around 25m (calculated with  with prefork)
> What could be the best setting with these value to have the maximum number
> of request at the same time without issue ?
> And so what will be the maximum MaxClients i can set with these value?
> Many thanks in advance for your kind help.

I don't know worker, we use event MPM. but it is somewhat similar in
that you have a number of worker threads spread across a number of
processes. We use these settings on our reasonably high traffic
reverse proxy:

# Each httpd child has 64 worker threads
ThreadsPerChild 64

# Start 8 children immediately for 512 workers
StartServers 8

# Have at most 16 servers
ServerLimit 16

# Start another child if we have less than 128 spare worker threads
MinSpareThreads 128

# Kill a child if we have more than 768 worker threads spare
MaxSpareThreads 768

With a threaded MPM, MaxClients is ServerLimit * ThreadsPerChild, so
this allows for 1024 max clients. Each httpd process has a maximum
SIZE of ~174M, and a RSS of around 75MB.

Depending upon how much memory you need to allocate to the PHP app,
and the proportion of hits that will require PHP you may need to scale
up/down - no point having 1024 httpd slots multiplexing to 10 PHP
workers if 90% of your requests require PHP.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message