On Wed, May 25, 2011 at 4:18 PM, Stéphane Guedon <stephane@22decembre.eu> wrote:
On Wednesday 25 May 2011 14:04:17 Vladimir Rusinov wrote:
> On Wed, May 25, 2011 at 3:34 PM, Stéphane Guedon
<stephane@22decembre.eu>wrote:
> > I read the apache2 doc, and I don't really know the principes of mpm.
> > Worker,
> > prefork... Don't understand really ! :(
>
> Ok, than in order to explain (or suggest books/articles) we need to know:
> Do you understand basic architecture concepts of multi-process network
> server?
> Do you understand what fork() is?

The only thing in this subject I have understood (I think, not sure... :) ) is
that apache start few child processes and it's this processes that respond to
requests.
 
Yep, this is correct.

Classic architecture of network server is a follows:
main process listens on network address, and when there is new client connection, it creates new child process (using fork() system call, which just duplicates process) or thread. Child process works with this new connection, while main continues to wait for next connection. So it is possible to process number of requests at the same time.
Apache (and many other web server) behaves and the same way, but it somewhat smarter: it maintains pool of processes, so there is no need to do fork() for each connection - fork might be quite expensive. This behavior called prefork, and it is being implemeted by prefork mpm, where mpm stands for 'multiprocessing module'.

There are other mpms exists as well: 'worker', which is basically the same as perfork, but it operates with threads, not with processes.
Thread is lighter (it is 'lightweight process'), it shares memory with other threads, it's faster to create and it have less overhead. But since all threads of the process have access to whole process memory, error in one thread could break other threads and cause whole process to die. This is usually not happens in stable environments, but it could happen for example with apache+mod_php+some exotic untested extension.

HTH

Yes, I am not skilled, but said it earlier, and I think of myself quite
courageous to get into Linux and Apache adventure without this knowledges...
:)

Good luck!
I could also suggest to read some articles/books about network programming. Good book is 'UNIX Network Programming' by Richard Stevens, but it could be overkill.

--
Vladimir Rusinov
http://greenmice.info/