Skip to content

Increase Apache ThreadsPerChild and MaxRequestWorkers

For reference, this is the default config:

<IfModule mpm_event_module>
        StartServers                     2
        MinSpareThreads          25
        MaxSpareThreads          75
        ThreadLimit                      64
        ThreadsPerChild          25
        MaxRequestWorkers         300
        MaxConnectionsPerChild   0
</IfModule>

This changes:

ThreadsPerChild from 25 to 50 MaxRequestWorkers from 300 to 800 (50 * the default 16 max servers)

I also increased MinSpareThreads to 75 and MaxSpareThreads to 250

I tested it on a VM, which isn't much of a test, but it did deploy, and Apache was happy enough to start up. I don't want to say these numbers are arbitrary, I did give them some thought, but they are mostly "bigger". I'm open to other suggestions.

This will use more memory on the server, on my VM the apache processes go from around 2 MB to near 4 MB switching between 25 and 50 ThreadsPerChild... but that's an idle server too. It's not a big increase, but I don't know how much headroom the server has on RAM.

I'm also not clear if overwriting the file is the "right" thing to do, are we supposed to create new entires in mods-available rather than changing the distributed configs?

Edited by Steven McDonald

Merge request reports

Loading