VinaCIS Network
Sunday, 05 September 2010
VinaCIS .NETWORK
Home arrow Solved Problems arrow Common problems arrow Understanding Max_client and Multi-Processing Modules (MPM)?

Articles
Webmaster
Security
Solved problems
Common problems
Linux problems
Windows problems
Plesk Control Panel
Advertise with us
Polls
Which Control Panel software would you prefer to use ?
 
Login Form





Lost Password?
No account yet? Register
Understanding Max_client and Multi-Processing Modules (MPM)? PDF Print E-mail
User Rating: / 0
PoorBest 

Problem:

What is  Multi-Processing Modules and how can I adjust MAX_CLIENT setting ?

Multi-Processing Modules (MPMs) extend the modular design of Apache technology used in the Covalent Enterprise Ready Server, Single Server Edition. These modules perform the most basic functions of a web server: binding to network ports on the machine, accepting requests, and dispatching children to handle the requests. MPMs allow Apache technology to cleanly and efficiently support a wide variety of operating systems.

With MPMs, the server can be better customized for the needs of the particular site. For example, sites that need a great deal of scalability can choose to use a threaded model such as the Worker MPM, while sites requiring stability or compatibility with older software can use the Prefork MPM.

MPMs must be compiled into the server. The Covalent Enterprise Ready Server, Single Server Edition for UNIX systems is shipped with two different pre-compiled versions of the Apache 2.0 server: the Prefork MPM and the Worker MPM. The Windows version is shipped with the Windows MPM pre-compiled.

Dynamic Load Handling Directives

The Apache 2.0 server dynamically adapts its load-it maintains enough server processes or threads to manage its current requests as well as a few spare requests to handle transients. You set these parameters for the server depending on which MPM you install.

Prefork MPM

This model implements a non-threaded, pre-forking server. It handles requests in a manner very similar to the default behaviour of Apache 1.3. This server is very robust. For example:

<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
MaxClients         150
MaxRequestsPerChild  0
</IfModule>

Worker MPM

This model implements a hybrid multi-process multi-threaded server for systems that support POSIX threads. Each process has a fixed number of threads. When a request is received, it is passed to a worker thread for processing. The server adjusts to changes in its load by increasing or decreasing the number of processes. This server scales very easily but emphasizes robustness. For example:

<IfModule worker.c>
StartServers         3
MaxClients           8
MinSpareThreads      5
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Windows MPM

This module uses a single control process. It launches a single child process which in turn creates threads to handle requests. It handles requests in a manner very similar to the default behaviour of Apache 1.3 on Win32. For example:

<IfModule mpm_winnt.c>
ThreadsPerChild    250
MaxRequestsPerChild  0
</IfModule>

StartServers

The number of server processes to start initially. You may need to increase this value on a very active system.

MaxClients

This sets a limit on the total number of server processes running on this system-that is, a limit on the number of clients who can simultaneously connect. When this limit is reached, subsequent clients will be unable to access the server. Avoid setting it too low.

The MaxClients setting should correlate with the resources available to the host system. You should set this value according to the memory available on your system. If it is set too high, it will induce swapping, which can be catastrophic for your system performance.

MaxRequestsPerChild

This controls the number of requests each server process is allowed to process before it is forced to terminate. The server exits to avoid problems after prolonged use, such as memory leaks or other resource issues. A setting of 0 (zero) means the server process is allowed to handle an unlimited number of requests.

MinSpareServers

The minimum number of server processes to be kept as spares. If there are fewer than the specified number of servers idle, Apache creates enough new processes to reach the minimum. If this number is set to low, your server response will be very slow as new server processes will have to be created when the server load is high.

This directive is only used by the Prefork MPM.

MaxSpareServers

The maximum number of idle server processes to be kept as spares. If there are more than the specified number of servers idle, Apache terminates the additional processes. Increasing this value will allow the server to respond more quickly to changing load conditions. However, note that increasing the number of server processes also increases the load on the host system.

This directive is only used by the Prefork MPM.

MinSpareThreads

Similar to the above, this defines the minimum number of worker threads to be kept as spares. If the number of idle worker threads drops below this number, Apache creates another new server process to handle the load.

Changing this value effects the threads in all worker processes.

This directive is only used by the Worker MPM.

MaxSpareThreads

Similar to the above, this defines the maximum number of worker threads to be kept as spares. If there are more than the specified number of worker threads idle, Apache terminates the process running those threads.

Changing this value effects the threads in all worker processes.

This directive is only used by the Worker MPM.

ThreadsPerChild

This defines the number of worker threads created in each server process. This is a constant value. If you set this to 25, the server will spawn 25 threads in each server process it creates.

This directive is used by the Worker MPM and the Windows MPM.

 
Next >

Top!