You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Bas A.Schulte" <bs...@zeelandnet.nl> on 2002/11/27 13:51:48 UTC

Getting at server's MaxClients setting?

Hi,

is it possible to get at the configured MaxClients setting from within 
my handler?

I checked Apache::Server which gives you some configuration information 
but there's no accessor for MaxClients.

Any other, easy, way?



Re: Getting at server's MaxClients setting?

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

Bas A.Schulte wrote:
> Geoff,
> 
> On Wednesday, November 27, 2002, at 03:07 PM, Geoffrey Young wrote:
> 
>> in this case, MaxClients looks like it calls ap_daemons_limit to make 
>> the setting, so you may be able to create a subclass that offers up 
>> that API to perl-land.  for more information on how, you can check out 
>> the slides from my recent ApacheCon talk:
>>
>> http://www.modperlcookbook.org/~geoff/slides/ApacheCon/oo-mod_perl-printable. 
>>
>> ppt.gz
>>
>> hmm... sounds like another good idea to add to my next talk :)
> 
> 
> Well, for the moment, I'll grep for it in the current httpd.conf ;)
> 
> Just thought I'd ask in case I was missing something obvious.

nope, you didn't miss anything.  unfortunately, mod_perl 1.X does not 
offer up the entire Apache API to perl land (though the intent of 2.0 
is to do just that).

actually, I just whipped up a module that offers get/set for MaxClients:

http://www.modperlcookbook.org/~geoff/modules/experimental/Apache-MaxClients-0.01.tar.gz

it's not perfect (it doesn't offer the checks that the MaxClients 
directive does), but it seems to work.  with a little effort, I 
suspect it could be worked out so that you don't need a request 
object, but rather an Apache::Server object.  however, it shows how 
easy mod_perl makes it to open up the Apache API where you need it.

--Geoff




Re: Getting at server's MaxClients setting?

Posted by "Bas A.Schulte" <bs...@zeelandnet.nl>.
Geoff,

On Wednesday, November 27, 2002, at 03:07 PM, Geoffrey Young wrote:

> in this case, MaxClients looks like it calls ap_daemons_limit to make 
> the setting, so you may be able to create a subclass that offers up 
> that API to perl-land.  for more information on how, you can check out 
> the slides from my recent ApacheCon talk:
>
> http://www.modperlcookbook.org/~geoff/slides/ApacheCon/oo-mod_perl-printable.
> ppt.gz
>
> hmm... sounds like another good idea to add to my next talk :)

Well, for the moment, I'll grep for it in the current httpd.conf ;)

Just thought I'd ask in case I was missing something obvious.

Thanks,

Bas.



Re: Getting at server's MaxClients setting?

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

Bas A.Schulte wrote:
> Hi,
> 
> is it possible to get at the configured MaxClients setting from within 
> my handler?
> 
> I checked Apache::Server which gives you some configuration information 
> but there's no accessor for MaxClients.
> 
> Any other, easy, way?
> 

see my previous post from earlier this week :)

http://marc.theaimsgroup.com/?l=apache-modperl&m=103791699126881&w=2

in this case, MaxClients looks like it calls ap_daemons_limit to make 
the setting, so you may be able to create a subclass that offers up 
that API to perl-land.  for more information on how, you can check out 
the slides from my recent ApacheCon talk:

http://www.modperlcookbook.org/~geoff/slides/ApacheCon/oo-mod_perl-printable.ppt.gz

hmm... sounds like another good idea to add to my next talk :)

--Geoff