Configure Apache prefork in httpd.conf

Mul′tiprocessovoj Processing module (MPM-multi-processing Module) prefork implements neperepletennyj, predrazvetvlâûŝijsâ web server that handles requests like Apache 1.3. This is necessary to ensure compatibility with the libraries.
Also this is the best MPM for isolating each request, so that a problem with a single query did not affect any other.
MPM prefork very autonomous and rarely need to change its settings to the defaults (default).
The most important parameter of the prefork MPM is the MaxClients!

HOW IT WORKS:
There is only the main (parent) process that is responsible for creating child processes which, in turn, listen to and process client requests. Apache always tries to keep in stock a few unused server processes that are ready to handle incoming requests.
In this way, clients do not have to wait for a new child processes to be razvetvlenny before their request to obslužitsâ.
Directive, MinSpareServers, MaxSpareServers, StartServers, and MaxClients regulate how the parent process creates children to serve requests.

In General, Apache is very self-contained, so for most web sites do not need to change these dirrektiv from the default (default).

For sites which need to serve more than 256 simultaneous requests, you may want to increase MaxClients, while sites located on servers with limited memory, you may want to reduce the value of MaxClients to not bring the server up to need svapa memory to disk (swapping memory to disk and back), which will lead to a strong zamedleniâm in the work.

Near the beginning of the main httpd.conf configuration file, we see the following:
# TimeOut: The number of seconds before receives and sends time out. Timeout 300 # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to “Off” to deactivate. KeepAlive On MaxKeepAliveRequests: The maximum # number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. MaxKeepAliveRequests 100 # KeepAliveTimeout: Number of seconds to wait for the next request from the same client # on the same connection. KeepAliveTimeout 15 # # Server-Pool Size Regulation (MPM specific) # prefork MPM # 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 # ServerLimit: maximum value for MaxClients for the lifetime of the server # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves < IfModule prefork. c > StartServers 5 MinSpareServers 5 MaxSpareServers 10 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 10000

# TimeOut: The number of seconds before receives and sends time out.
Timeout 300

# The KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to “Off” to deactivate.
Keepalive On

# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
MaxKeepAliveRequests 100

# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
KeepAliveTimeout 15

# # Server-Pool Size Regulation (MPM specific)

# prefork MPM
# 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
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
< IfModule prefork. c >
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 10000

Now in order for each dirrektive of …

Timeout 300 (default)
Time to wait (in seconds) before you trying to receive or give a time-out message.

KeepAlive On (default)
Whether to allow persistent connections. To disable specify Off.
Persistentnoe connection (persistent connection keep-alive) is a type of virtual connection between the server and the client, the server can handle more than one request from the same client on the same connection, that is, which is not terminated immediately, as soon as the Server handled the first client request for which this connection has been established,