How to choose a MPM module

This is not an indepth topic but i will explain the difference between a prefork MPM and worker MPM. ( reference:- apache.org )

Before you start reading anything about MPM, multi threading etc first thing you need to understand is the difference between a  Process and a Thread and then everything would turn out to be simple. A single process can have multiple threads that share global data and address space with other threads running in the same process, and therefore can operate on the same data set easily. Processes do not share address space and a different mechanism must be used if they are to share data.

If we consider running a word processing program to be a process, then the auto-save and spell check features that occur in the background are different threads of that process which are all operating on the same data set (your document).

Process

In computing, a process is an instance of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently.

Thread

A single process may contain several executable programs (threads) that work together as a coherent whole. One thread might, for example, handle error signals, another might send a message about the error to the user, while a third thread is executing the actual task

So the main difference between prefork MPM and worker MPM is :-

  • The  worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server. Yet it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads. Worker generally is a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM.
  • The  prefork MPM uses multiple child processes with one thread each. Each process handles one connection at a time. On many systems, prefork is comparable in speed to worker, but it uses more memory. Prefork’s threadless design has advantages over worker in some situations: it can be used with non-thread-safe third-party modules, and it is easier to debug on platforms with poor thread debugging support. :)
Share and Enjoy:
  • Digg
  • Mixx
  • del.icio.us
  • StumbleUpon
  • Facebook
  • TwitThis
  • Technorati
  • Google

Leave a Reply