Skip to content

Instantly share code, notes, and snippets.

@joergpatz
Created April 30, 2014 10:40
Show Gist options
  • Save joergpatz/94b117fc496db3512e91 to your computer and use it in GitHub Desktop.
Save joergpatz/94b117fc496db3512e91 to your computer and use it in GitHub Desktop.
Apache prefork vs. worker
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# implements a non-threaded, pre-forking web server (isolating each request)
# physical RAM hungry, maxclients is important
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
Angepasst
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
Original
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 5
MaxClients 25
MaxRequestsPerChild 0
</IfModule>
# worker MPM
# using threads to serve requests
# serve a large number of requests with less system resources than a process-based server
# MaxClients and ThreadsPerChild is important
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
Angepasst
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 50
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Original
<IfModule mpm_worker_module>
StartServers 1
MaxClients 25
MinSpareThreads 1
MaxSpareThreads 4
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment