How can I get the Apache server number?
am 14.10.2009 21:14:44 von Adam Woodworth
Say you're using the prefork MPM and you have 200 Apache children. Is
there a way, within mod_perl, to find out what the server number is
for the apache child in which mod_perl is running? Not the PID
number, but the server number (or whatever it's called) -- i.e., a
number between 1 and 200 that indicates which "slot" you're taking up
in the Apache list of children.
Thanks!
Adam
Re: How can I get the Apache server number?
am 19.10.2009 19:59:59 von Adam Woodworth
By looking at the apache source code, I've determined that the
connection->id is the server slot number when using the pre-fork MPM.
Yay!
On Sat, Oct 17, 2009 at 10:34 AM, Paul Silevitch wrote=
:
> I think the "id" method in Apache2::Connection module returns the slot
> number (starting at 0). =A0The documentation seems a little misleading
> (http://perl.apache.org/docs/2.0/api/Apache2/Connection.html #C_id_). =A0A=
nyone
> else ever use this method for this purpose?
> Thanks,
> Paul
>
> On Wed, Oct 14, 2009 at 3:14 PM, Adam Woodworth wrot=
e:
>>
>> Say you're using the prefork MPM and you have 200 Apache children. =A0Is
>> there a way, within mod_perl, to find out what the server number is
>> for the apache child in which mod_perl is running? =A0Not the PID
>> number, but the server number (or whatever it's called) -- i.e., a
>> number between 1 and 200 that indicates which "slot" you're taking up
>> in the Apache list of children.
>>
>> Thanks!
>> Adam
>
>