Apache Performance Tuning on Linux

Types of MPMs

MPM Prefork

MPM Worker

MPM Event

MPM Values

StartServers

MinSpareServers

MaxSpareServers

MaxConnectionsPerChild

ThreadsPerChild

MaxRequestWorkers

top

MaxRequestWorkers = (2048MB — 250MB — 100MB) / (0.8 / 100 * 2048MB) = ~ 103

ServerLimit

What Is the Default MPM Settings?

For Prefork Module

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 250 // MaxRequestWorkers
MaxRequestsPerChild 0 // MaxConnectionsPerChild

For Worker or Event Module

StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxClients 400 // MaxRequestWorkers
MaxRequestsPerChild 0 // MaxConnectionsPerChild
<IfModule MODULE_NAME>
StartServers 4
MinSpareServers 20
MaxSpareServers 40
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>

Other Settings That May Affect MPM

KeepAlive

KeepAlive On

MaxKeepAliveRequests

MaxKeepAliveRequests 500

Tools That Would Help You

Apache2Buddy

curl -sL https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl | perl

ApacheBench Tool (ab)

ab -k -n 1000 -c 10 "http://yoursite.com/test"
top

References and Useful Links

Original Source

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store