最後更新: 2021-08-09
介紹
Prefork 與 Worker 的分別
Prefork: Each child process handles one connection at a time
Worker: Uses multiple child processes which each have multiple threads
Event MPM
A variant of the worker MPM with the goal of consuming threads only for connections with active processing
* mod_php is only compatible with the Prefork MPM
mpm_prefork_module (Multi-Processing Module)
implements a non-threaded, pre-forking web server
a parent process manages the size of the server pool.
(compatibility with non-thread-safe libraries)
# worker and event default to "StartServers 3"
StartServers 5
# An idle process is one which is not handling a request.
# If there are fewer than MinSpareServers idle, then the parent process creates new children:
# It will spawn one, wait a second, then spawn two, wait a second, then spawn four (exponentially)
MinSpareServers 5
#If you are trying to set the value equal to or lower than MinSpareServers,
#Apache HTTP Server will automatically adjust it to MinSpareServers + 1.
MaxSpareServers 10
# sets the limit on the number of simultaneous requests that will be served
# Any connection attempts over the MaxRequestWorkers limit will normally be queued
# (up to "ListenBacklog 511")
# Once a child process is freed at the end of a different request, the connection will then be serviced.
MaxRequestWorkers 256
# the maximum configured value for MaxRequestWorkers for the lifetime of the Apache httpd process.
ServerLimit 256