httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject Re: [users@httpd] apache 2.4 with MPM Event recommend config
Date Fri, 26 Apr 2013 15:50:49 GMT
On Fri, Apr 26, 2013 at 3:41 PM, Mike Franon <> wrote:
> Hi,
> I recently moved to apache 2.4.4 with php-fpm, mod_fastcgi, and MPM Event.
> I was curious what values do I need to change to optimize apache?
> I remember in 2.4 prefork I had to change several like MaxClients and
> MaxRequestsPerChild
> The server I am running it on has 30 GB Ram, and 8 Cores
> I know usually the defaults are not great out of the box and curious if you
> have any recommendations to get the best performance possible for apache 2.4
> Thanks

What are your average and max concurrent requests per second that you
want to achieve? Simply tune to that - you will find apache with event
MPM (and without language interpreters embedded in httpd, eg using
php-fcgi) does not use much memory or CPU at all.

Eg, for our moderately loaded proxies, which use apache 2.2 with event
MPM, we have average of around 50 RPS (per proxy, there are a few of
them), with peaks of around 500 RPS. We configure the server:

    StartServers 8
    MaxClients 1024
    MinSpareThreads 128
    MaxSpareThreads 768
    ThreadsPerChild 64
    MaxRequestsPerChild 0

So we start 8 servers, each with 64 threads, giving us 512 request
slots immediately. Whenever there are less than 128 spare slots, we
start an extra server, up to a maximum of 1024 slots (16 servers), and
we reap a server whenever there are more than 768 spare slots. We also
trust that Apache without interpreters does not leak RAM, so don't
bother reaping servers after a certain number of handled requests.

Our normal and peak usage fits in to the slots started initially, with
scope to grow if needed. These servers only serve static files off
disk, or proxy requests to backend servers. Memory usage and load
remain steady on each proxy, apache uses less than 1 GB of RAM, load
average has never been above 1.

Hope that helps



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

View raw message