* [gentoo-server] apache2 threads
@ 2011-05-25 8:38 Stéphane Guedon
2011-05-25 10:20 ` Florian Philipp
2011-05-25 11:03 ` Jos Houtman
0 siblings, 2 replies; 7+ messages in thread
From: Stéphane Guedon @ 2011-05-25 8:38 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: Text/Plain, Size: 321 bytes --]
Please, will you excuse a quite unskilled linuxman, but, what does threads add
to apache2 ?
Thank you !
--
Stéphane Guedon
page web : http://www.22decembre.eu/
carte de visite : http://www.22decembre.eu/downloads/Stephane-Guedon.vcf
clé publique gpg : http://www.22decembre.eu/downloads/Stephane-Guedon.asc
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 8:38 [gentoo-server] apache2 threads Stéphane Guedon
@ 2011-05-25 10:20 ` Florian Philipp
2011-05-25 11:34 ` Stéphane Guedon
2011-05-25 11:03 ` Jos Houtman
1 sibling, 1 reply; 7+ messages in thread
From: Florian Philipp @ 2011-05-25 10:20 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
Am 25.05.2011 10:38, schrieb Stéphane Guedon:
> Please, will you excuse a quite unskilled linuxman, but, what does threads add
> to apache2 ?
>
> Thank you !
When you enable this use flag, and have not specified an MPM, the ebuild
will select worker as the default. Otherwise it is prefork.
Also, if you select a non-threaded MPM like prefork, you must compile
with -threads and for threaded MPMs like worker, you have to enable the
flag.
I don't see any other use of this flag in the ebuild's eclass but I'm
not really proficient in these.
Hope this helps,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 8:38 [gentoo-server] apache2 threads Stéphane Guedon
2011-05-25 10:20 ` Florian Philipp
@ 2011-05-25 11:03 ` Jos Houtman
1 sibling, 0 replies; 7+ messages in thread
From: Jos Houtman @ 2011-05-25 11:03 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: text/plain, Size: 699 bytes --]
Hi,
See: http://www.gentoo.org/proj/en/apache/doc/upgrading.xml#doc_chap4
threads: Selects the default MPM if none is set in APACHE2_MPMS
You can find more information about Multi-Processing Modules here:
http://httpd.apache.org/docs/2.0/mod/
Regards,
Jos
On Wed, May 25, 2011 at 10:38 AM, Stéphane Guedon <stephane@22decembre.eu>wrote:
> Please, will you excuse a quite unskilled linuxman, but, what does threads
> add
> to apache2 ?
>
> Thank you !
> --
> Stéphane Guedon
> page web : http://www.22decembre.eu/
> carte de visite : http://www.22decembre.eu/downloads/Stephane-Guedon.vcf
> clé publique gpg : http://www.22decembre.eu/downloads/Stephane-Guedon.asc
>
[-- Attachment #2: Type: text/html, Size: 2286 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 10:20 ` Florian Philipp
@ 2011-05-25 11:34 ` Stéphane Guedon
2011-05-25 12:04 ` Vladimir Rusinov
0 siblings, 1 reply; 7+ messages in thread
From: Stéphane Guedon @ 2011-05-25 11:34 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: Text/Plain, Size: 1026 bytes --]
On Wednesday 25 May 2011 12:20:57 Florian Philipp wrote:
> Am 25.05.2011 10:38, schrieb Stéphane Guedon:
> > Please, will you excuse a quite unskilled linuxman, but, what does
> > threads add to apache2 ?
> >
> > Thank you !
>
> When you enable this use flag, and have not specified an MPM, the ebuild
> will select worker as the default. Otherwise it is prefork.
>
> Also, if you select a non-threaded MPM like prefork, you must compile
> with -threads and for threaded MPMs like worker, you have to enable the
> flag.
>
> I don't see any other use of this flag in the ebuild's eclass but I'm
> not really proficient in these.
>
> Hope this helps,
> Florian Philipp
I read the apache2 doc, and I don't really know the principes of mpm. Worker,
prefork... Don't understand really ! :(
--
Stéphane Guedon
page web : http://www.22decembre.eu/
carte de visite : http://www.22decembre.eu/downloads/Stephane-Guedon.vcf
clé publique gpg : http://www.22decembre.eu/downloads/Stephane-Guedon.asc
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 11:34 ` Stéphane Guedon
@ 2011-05-25 12:04 ` Vladimir Rusinov
2011-05-25 12:18 ` Stéphane Guedon
0 siblings, 1 reply; 7+ messages in thread
From: Vladimir Rusinov @ 2011-05-25 12:04 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: text/plain, Size: 457 bytes --]
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?
--
Vladimir Rusinov
http://greenmice.info/
[-- Attachment #2: Type: text/html, Size: 775 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 12:04 ` Vladimir Rusinov
@ 2011-05-25 12:18 ` Stéphane Guedon
2011-05-25 14:04 ` Vladimir Rusinov
0 siblings, 1 reply; 7+ messages in thread
From: Stéphane Guedon @ 2011-05-25 12:18 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: Text/Plain, Size: 1025 bytes --]
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.
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...
:)
--
Stéphane Guedon
page web : http://www.22decembre.eu/
carte de visite : http://www.22decembre.eu/downloads/Stephane-Guedon.vcf
clé publique gpg : http://www.22decembre.eu/downloads/Stephane-Guedon.asc
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-server] apache2 threads
2011-05-25 12:18 ` Stéphane Guedon
@ 2011-05-25 14:04 ` Vladimir Rusinov
0 siblings, 0 replies; 7+ messages in thread
From: Vladimir Rusinov @ 2011-05-25 14:04 UTC (permalink / raw
To: gentoo-server
[-- Attachment #1: Type: text/plain, Size: 2501 bytes --]
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/
[-- Attachment #2: Type: text/html, Size: 3263 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-25 14:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 8:38 [gentoo-server] apache2 threads Stéphane Guedon
2011-05-25 10:20 ` Florian Philipp
2011-05-25 11:34 ` Stéphane Guedon
2011-05-25 12:04 ` Vladimir Rusinov
2011-05-25 12:18 ` Stéphane Guedon
2011-05-25 14:04 ` Vladimir Rusinov
2011-05-25 11:03 ` Jos Houtman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox