This Multi-Processing Module (MPM) implements a hybrid multi-process, multi-threaded web server. A fixed number of processes create threads to handle requests. Fluctuations in load are handled by increasing or decreasing the number of threads in each process.
A single control process launches the number of child processes
indicated by the
Apache always tries to maintain a pool of spare or
idle server threads, which stand ready to serve incoming
requests. In this way, clients do not need to wait for new
threads to be created. For each child process, Apache assesses
the number of idle threads and creates or destroys threads to
keep this number within the boundaries specified by
While the parent process is usually started as root under
Unix in order to bind to port 80, the child processes and
threads are launched by Apache as a less-privileged user. The
The
The following example runs 7 child processes. Two of them are run
under user1
/group1
. The next four are run
under user2
/group2
and the remaining
process uses the
Using unbalanced numbers of processes as above is useful, if the
particular virtual hosts produce different load. The assignment to
the virtual hosts is easily done as in the example below. In
conclusion with the example above the following assumes, that
server2
has to serve about twice of the hits of
server1
.
Tie a virtual host to a specific user/group combination. Requests addressed to the virtual host where this directive appears will be served by a process running with the specified user and group ID.
The user and group ID has to be assigned to a number of children
in the global server config using the
Specify a user ID and group ID for a number of child processes.
The third argument, num-children, is the number of child
processes to start with the specified user and group. It does
not represent a specific child number. In order to use this
directive, the server must be run initially as root
.
If you start the server as a non-root user, it will fail to change
to the lesser privileged user.
If the total number of child processes, found by totaling all of the
third arguments to all
Don't set user-id (or group-id) to
root
unless you know exactly what you are doing, and
what the dangers are.
This directive sets the maximum number of threads that will be
created in each child process. To increase this value beyond its
default, it is necessary to change the value of the
The 8
, it is necessary to change the value of the