You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2003/11/18 03:00:18 UTC

Re: [patch] adding mpm info to httpd -V

Geoffrey Young wrote:

> Server version: Apache/2.1.0-dev
> Server built:   Aug 12 2003 02:25:22
> Server's Module Magic Number: 20030213:1
> Architecture:   32-bit
> Server MPM:     Prefork

too bad ap_show_mpm doesn't list this like other modules :( ("prefork.c" or 
"worker.c")... the major source file name is what you need in <IfModule FOO>

also, we can axe the display of the MPM directory, right?  what good is that? 
or does the test suite use that?





Re: [patch] adding mpm info to httpd -V

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> commited to 2.1-dev... thanks!

sure.  and thanks for taking the time to shepherd it through.

--Geoff


Re: [patch] adding mpm info to httpd -V

Posted by Jeff Trawick <tr...@attglobal.net>.
Geoffrey Young wrote:
> here is the latest patch.  basically, it's the same as what I submitted
> before.  the differences are those suggested by stas and jeff - make the
> AP_MPMQ_STATIC/DYNAMIC wording a bit better and axe the "-D APACHE_MPM_DIR="
> stuff.

commited to 2.1-dev... thanks!



Re: [patch] adding mpm info to httpd -V

Posted by Jeff Trawick <tr...@attglobal.net>.
Geoffrey Young wrote:

> here is the latest patch.  basically, it's the same as what I submitted
> before.  the differences are those suggested by stas and jeff - make the
> AP_MPMQ_STATIC/DYNAMIC wording a bit better and axe the "-D APACHE_MPM_DIR="
> stuff.

this looks good to me (i.e., this is the last chance for anybody to complain)




Re: [patch] adding mpm info to httpd -V

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> I'll work on the real httpd -V
> stuff later this afternoon.

here is the latest patch.  basically, it's the same as what I submitted
before.  the differences are those suggested by stas and jeff - make the
AP_MPMQ_STATIC/DYNAMIC wording a bit better and axe the "-D APACHE_MPM_DIR="
stuff.

so, the output looks like this for worker and prefork.

Server version: Apache/2.1.0-dev
Server built:   Dec  2 2003 03:28:43
Server's Module Magic Number: 20030821:2
Architecture:   32-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
[etc]

Server version: Apache/2.1.0-dev
Server built:   Dec  2 2003 02:44:12
Server's Module Magic Number: 20030821:2
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
[etc]

patch against current 2.1

--Geoff

Re: new directive (was Re: [patch] adding mpm info to httpd -V)

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

William A. Rowe, Jr. wrote:
> At 02:10 PM 12/3/2003, Geoffrey Young wrote:
> 
> 
>>>><IfThreaded>
>>>>    MaxThreadsPerChild   5
>>>></IfThreaded>
>>>
>>>
>>>This rubs me the wrong way FWIW.  
>>
>>oops, sorry :)
> 
> 
> I don't care for that container either... but even horrible new ideas 
> are always good when then generate more ideas :)

:)

> 
> 
>>>If somebody really wants to do this they
>>>could use IfDefine;  though it would be easier if the core pre-defined
>>>some symbol for use in IfDefine, it is doable as-is.
>>
>>sure.  the only reason I didn't go that way was that the docs seem to say
>>that <IfDefine> only applies to -D command-line parameters - I wasn't
>>familiar enough with the directives to see if there were other, internal -D
>>flags that were also used.
> 
> 
> Actually, such defines might need to be a little more dynamic, but either
> <IfDefine AP_MPM_THREADED> would be good, or if we absolutely
> needed too, we could add <IfFeature FOO> where features could be
> registered, by the core or by a loaded module.

actually, the other idea I had (going for 0-2 on the horrible new idea theme
:) was <IfMPM AP_MPMQ_IS_THREADED> (or somesuch) as a direct interface to
ap_mpm_query, but I thought that outside of threaded/forked there wasn't
much other useful config-time information there.

but either/any form would probably be valuable to somebody somewhere along
the line.

> 
> Individual <IfFoo> blocks would pollute the command table significantly,
> slowing down config parsing by a corresponding amount.

ah, good point.

--Geoff


Re: new directive

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Actually, such defines might need to be a little more dynamic, but either
> <IfDefine AP_MPM_THREADED> would be good, or if we absolutely
> needed too, we could add <IfFeature FOO> where features could be
> registered, by the core or by a loaded module.

to that end, here's a preliminary and rough patch for

<IfServerIs !threaded>

(substitute 'IfServerIs' for whatever you please - I'm not so good with names).

I couldn't think of anything else to implement other than threadedness right
now, but I guess we're discussing the concept at the moment so that's ok.  I
did almost start on

<IfServerIs >= 2.1>

but I thought that the new container semantics probably wouldn't go over
well (and I wasn't entirely convinced that was a worthy thing to test at
config time).

--Geoff

Re: new directive (was Re: [patch] adding mpm info to httpd -V)

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
At 02:10 PM 12/3/2003, Geoffrey Young wrote:

>>> <IfThreaded>
>>>     MaxThreadsPerChild   5
>>> </IfThreaded>
>> 
>> 
>> This rubs me the wrong way FWIW.  
>
>oops, sorry :)

I don't care for that container either... but even horrible new ideas 
are always good when then generate more ideas :)

>> If somebody really wants to do this they
>> could use IfDefine;  though it would be easier if the core pre-defined
>> some symbol for use in IfDefine, it is doable as-is.
>
>sure.  the only reason I didn't go that way was that the docs seem to say
>that <IfDefine> only applies to -D command-line parameters - I wasn't
>familiar enough with the directives to see if there were other, internal -D
>flags that were also used.

Actually, such defines might need to be a little more dynamic, but either
<IfDefine AP_MPM_THREADED> would be good, or if we absolutely
needed too, we could add <IfFeature FOO> where features could be
registered, by the core or by a loaded module.

Individual <IfFoo> blocks would pollute the command table significantly,
slowing down config parsing by a corresponding amount.

Bill


new directive (was Re: [patch] adding mpm info to httpd -V)

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> <IfThreaded>
>>     MaxThreadsPerChild   5
>> </IfThreaded>
> 
> 
> This rubs me the wrong way FWIW.  

oops, sorry :)

> I think it is best to have all
> directives for a specific MPM together in one container, and have that
> container specific to the MPM.  

well, in some cases I'd certainly agree.  however, I think that some "if I
have a threaded MPM" container would be genuinely useful.  consider the
perl-framework, where the default httpd.conf that is generated has the exact
same directives

<IfModule worker.c>
    StartServers         1
    MaxClients           1
    MinSpareThreads      1
    MaxSpareThreads      1
    ThreadsPerChild      1
    MaxRequestsPerChild  0
</IfModule>

for both worker and perchild (and we'd need the same for leader someday I
suppose).

granted, this kind of duplication might make sense in some circumstances.
however, specifically for non-core directives it might be nice to have such
a feature.  for instance, I can see some value in

<IfThreaded>
  # if using a threaded mpm load some ultra-slow but threadsafe
  # version of some ultra-fast but non-threadsafe module
</IfThreaded>

if this kind of thing (someday) applies to, say, php folks, then asking them
to duplicate this for each and every possible threaded MPM seems to be
asking a bit much.

but maybe this is all just academic anyway.  thanks for listening
nonetheless :)

> If somebody really wants to do this they
> could use IfDefine;  though it would be easier if the core pre-defined
> some symbol for use in IfDefine, it is doable as-is.

sure.  the only reason I didn't go that way was that the docs seem to say
that <IfDefine> only applies to -D command-line parameters - I wasn't
familiar enough with the directives to see if there were other, internal -D
flags that were also used.

--Geoff



Re: [patch] adding mpm info to httpd -V

Posted by Jeff Trawick <tr...@attglobal.net>.
Geoffrey Young wrote:

> contrary to your advice, I took the initiative and coded <IfThreaded>
> against 2.1.  basically, this would allow you to group threaded directives
> together.  so, instead of this
> 
> <IfModule worker.c>
>     ThreadsPerChild      5
> </IfModule>

> and so on for every threaded mpm, we could have
> 
> <IfThreaded>
>     MaxThreadsPerChild   5
> </IfThreaded>

This rubs me the wrong way FWIW.  I think it is best to have all directives for 
a specific MPM together in one container, and have that container specific to 
the MPM.  If somebody really wants to do this they could use IfDefine;  though 
it would be easier if the core pre-defined some symbol for use in IfDefine, it 
is doable as-is.



Re: [patch] adding mpm info to httpd -V

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> wow, I didn't expect to see this followed up upon.  thanks.
> 
> 
> maybe httpd developers should be stranded in airports more often... 
> also, several weeks ago somebody was complaining to me about various
> things they didn't like about Apache 2... one of the ones I took note of
> was having httpd -V display the name of the MPM...  so when I saw your
> old post I could visualize that to-do getting marked DONE with little
> effort on my part :)

:)


> 
>>>> Server version: Apache/2.1.0-dev
>>>> Server built:   Aug 12 2003 02:25:22
>>>> Server's Module Magic Number: 20030213:1
>>>> Architecture:   32-bit
>>>> Server MPM:     Prefork
>>>
>>>
>>>
>>>
>>> too bad ap_show_mpm doesn't list this like other modules :(
>>> ("prefork.c" or "worker.c")... the major source file name is what you
>>> need in <IfModule FOO>
>>
>>
>>
>> hmm... odd.  I guess I'll take your word for it that doesn't work now 

oh, I see what you mean now - <IfModule prefork.c> works but httpd -V
doesn't show prefork.c.

> 
> 
> very minor issue... forget about it :)

k :)

> 
>> but if it doesn't I'd be happy to try and make it work if there is a
>> consensus that it would be a good thing.  the only issue I can see is
>> something mentioned in the original thread on test-dev@ - that
>> attributes like being threaded (or not) are generally more useful than
>> the more simplistic approach of looking for worker.c.
>>
>> http://marc.theaimsgroup.com/?l=apache-test-dev&m=105795076610731&w=2
> 
> 
> do whatever Stas said w.r.t. that :)

well, I wasn't taling about the Apache-Test stuff, per se, but rather what
Bill had to say about querying for specific mpm's versus threads in general,
which I think is a very good point - I actually care very little in my code
whether apache is using worker or leader, it's threads or not that's
important (to me anyway :)  thus the below...

> 
>> nevertheless, I'd be happy to do the scut work here and code both up
>> (httpd -V and IfDefine/IfModule stuff) if some agreement can be
>> reached on exactly what it all ought to look like.
> 
> 
> scratch the Ifdefine issue for now...  I don't think it is so
> important...  at worst, we just have to change the definition of the
> MPM_NAME symbol in each MPM's header file

contrary to your advice, I took the initiative and coded <IfThreaded>
against 2.1.  basically, this would allow you to group threaded directives
together.  so, instead of this

<IfModule worker.c>
    ThreadsPerChild      5
</IfModule>


<IfModule perchild.c>
    MaxThreadsPerChild   5
</IfModule>

<IfModule prefork.c>
    MaxClients           5
</IfModule>

and so on for every threaded mpm, we could have

<IfThreaded>
    MaxThreadsPerChild   5
</IfThreaded>

<IfModule prefork.c>
    MaxClients           5
</IfModule>

I toyed with the idea of adding <IfNotThreaded> to parallel the concept, but
I wasn't sure about it - I figured I'd see how the initial idea went over
first :)

so, patch attached and feedback welcome.  I'll work on the real httpd -V
stuff later this afternoon.

--Geoff

Re: [patch] adding mpm info to httpd -V

Posted by Jeff Trawick <tr...@attglobal.net>.
Geoffrey Young wrote:

> Jeff Trawick wrote:
> 
>> Geoffrey Young wrote:
> 
> wow, I didn't expect to see this followed up upon.  thanks.

maybe httpd developers should be stranded in airports more often...  also, 
several weeks ago somebody was complaining to me about various things they 
didn't like about Apache 2... one of the ones I took note of was having httpd 
-V display the name of the MPM...  so when I saw your old post I could 
visualize that to-do getting marked DONE with little effort on my part :)

>>> Server version: Apache/2.1.0-dev
>>> Server built:   Aug 12 2003 02:25:22
>>> Server's Module Magic Number: 20030213:1
>>> Architecture:   32-bit
>>> Server MPM:     Prefork
>>
>>
>>
>> too bad ap_show_mpm doesn't list this like other modules :( 
>> ("prefork.c" or "worker.c")... the major source file name is what you 
>> need in <IfModule FOO>
> 
> 
> hmm... odd.  I guess I'll take your word for it that doesn't work now 

very minor issue... forget about it :)

> but if it doesn't I'd be happy to try and make it work if there is a 
> consensus that it would be a good thing.  the only issue I can see is 
> something mentioned in the original thread on test-dev@ - that 
> attributes like being threaded (or not) are generally more useful than 
> the more simplistic approach of looking for worker.c.
> 
> http://marc.theaimsgroup.com/?l=apache-test-dev&m=105795076610731&w=2

do whatever Stas said w.r.t. that :)

> nevertheless, I'd be happy to do the scut work here and code both up 
> (httpd -V and IfDefine/IfModule stuff) if some agreement can be reached 
> on exactly what it all ought to look like.

scratch the Ifdefine issue for now...  I don't think it is so important...  at 
worst, we just have to change the definition of the MPM_NAME symbol in each 
MPM's header file

>> also, we can axe the display of the MPM directory, right?  what good 
>> is that? or does the test suite use that?
> 
> 
> currently, the test suite uses it to infer the mpm (worker, prefork, 
> etc). but I don't see any reason (from the perspective of the 
> perl-framework) that it can't be moved, provided there is some other way 
> to determine the mpm (or relevant underlying mpm attributes).

so if you provide the other info, then the test suite won't need the directory

I'd say definitely yank the display of that directory for 2.1...  we can decide 
  when considering the patch for merge to stable branch whether or not we 
expect to hurt anybody by axing the directory



Re: [patch] adding mpm info to httpd -V

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Jeff Trawick wrote:
> Geoffrey Young wrote:

wow, I didn't expect to see this followed up upon.  thanks.

> 
>> Server version: Apache/2.1.0-dev
>> Server built:   Aug 12 2003 02:25:22
>> Server's Module Magic Number: 20030213:1
>> Architecture:   32-bit
>> Server MPM:     Prefork
> 
> 
> too bad ap_show_mpm doesn't list this like other modules :( ("prefork.c" 
> or "worker.c")... the major source file name is what you need in 
> <IfModule FOO>

hmm... odd.  I guess I'll take your word for it that doesn't work now (I'm 
on conference overload and really can't think straight at the moment :)

but if it doesn't I'd be happy to try and make it work if there is a 
consensus that it would be a good thing.  the only issue I can see is 
something mentioned in the original thread on test-dev@ - that attributes 
like being threaded (or not) are generally more useful than the more 
simplistic approach of looking for worker.c.

http://marc.theaimsgroup.com/?l=apache-test-dev&m=105795076610731&w=2

nevertheless, I'd be happy to do the scut work here and code both up (httpd 
-V and IfDefine/IfModule stuff) if some agreement can be reached on exactly 
what it all ought to look like.

> 
> also, we can axe the display of the MPM directory, right?  what good is 
> that? or does the test suite use that?

currently, the test suite uses it to infer the mpm (worker, prefork, etc). 
but I don't see any reason (from the perspective of the perl-framework) that 
it can't be moved, provided there is some other way to determine the mpm (or 
relevant underlying mpm attributes).

again, thanks for your interest - it is really appreciated.

--Geoff