You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jordi Prats <jo...@gmail.com> on 2008/08/08 10:12:11 UTC
mod_status slots
Hi all,
I've seen that mod_status shows the number of slots available as the
ServerLimit directive. In my opinion this is not meaningful because if
you set the MaxClient directive to a lower value it does not reflect
on the available slots on mod_status.
I would like to suggest to change this behaviour by just changing a line:
diff -Naur httpd-orig/modules/generators/mod_status.c
httpd-mod/modules/generators/mod_status.c
--- httpd-orig/modules/generators/mod_status.c 2008-01-02
10:43:52.000000000 +0100
+++ httpd-mod/modules/generators/mod_status.c 2008-08-08
10:04:26.000000000 +0200
@@ -848,7 +848,7 @@
status_flags[SERVER_GRACEFUL] = 'G';
status_flags[SERVER_IDLE_KILL] = 'I';
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
- ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit);
+ ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &server_limit);
return OK;
}
I don't know about other implications of changing this line. I've just
tested it using prefork both restarting and reloading apache. What do
you think about this little change?
regards,
--
Jordi
Re: mod_status slots
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jordi Prats wrote:
> How can I test that? I've repeated this test succesfully like this:
That looks great, thanks for confirming!
Re: mod_status slots
Posted by Jordi Prats <jo...@gmail.com>.
How can I test that? I've repeated this test succesfully like this:
first shell:
I perform continuous ab test like this:
while true; do /usr/local/apache2/bin/ab -c 14 -n 5000
http://127.0.0.1/server-status; done
second shell:
I store the ScoreBoard to a file:
while true; do wget http://10.12.80.1/server-status?auto -O -
2>/dev/null| grep Scoreboard >> /tmp/foo; done
third shell:
I do a graceful with two echos (before and after) using this command:
echo "before graceful" >> /tmp/foo; /usr/local/apache2/bin/apachectl
graceful; echo "after graceful" >> /tmp/foo;
Then, on /tmp/foo you can find something like this:
Scoreboard: WCCCCWCCCCCWCCC
Scoreboard: _CC_CCCWCCCCCCC
Scoreboard: CCCCCCCC_CCWCCC
Scoreboard: WCCCCCC_C_CCC_C
Scoreboard: CCCCCCCCCCCCCCW
Scoreboard: CCCCCCCCC_CCW__
Scoreboard: CCCCCWCCCCCCCCC
Scoreboard: CCCCCCCCCCCW_CC
Scoreboard: __CCC_CCWCCCCCC
Scoreboard: CCCCCCCWCCCCC__
Scoreboard: CCW__C_CCC__WC_
Scoreboard: C_CCCCCC_CCCWCC
Scoreboard: CC_CCCC_C_CCCWC
Scoreboard: CCCCWCCCCCCCCCC
before graceful
Scoreboard: ___CW_CW_CCCC_C
Scoreboard: __WCCRCC_CCCCCC
Scoreboard: __CCC_C_C_CWCCC
Scoreboard: CC_CCCWCCC_CCCC
Scoreboard: CCCCCC__CWCCWCC
after graceful
Scoreboard: WGGCC
Scoreboard: RCCWC
Scoreboard: WCCWC
Scoreboard: WWCCC
Scoreboard: CCWCW
Scoreboard: CWCCC
Scoreboard: CCCWC
Scoreboard: CCCWW
Scoreboard: CWCCC
On Mon, Sep 8, 2008 at 6:00 PM, William A. Rowe, Jr.
<wr...@rowe-clan.net> wrote:
> Jordi Prats wrote:
>>
>> Hi all,
>> There's any way to formally propose this littler change to mod_status?
>>
>> Jordi
>>
>> On Mon, Aug 11, 2008 at 9:57 AM, Jordi Prats <jo...@gmail.com>
>> wrote:
>>>
>>> On Fri, Aug 8, 2008 at 7:04 PM, William A. Rowe, Jr.
>>> <wr...@rowe-clan.net> wrote:
>>>>
>>>> Jordi Prats wrote:
>>>>>
>>>>> I don't know about other implications of changing this line. I've just
>>>>> tested it using prefork both restarting and reloading apache. What do
>>>>> you think about this little change?
>>>>
>>>> How's your proposed patch interact with a server using slots 1-16,
>>>> 128-136
>>>> when they gracefully restart the server with a lower number of
>>>> maxclients?
>>>>
>>> It works fine. For example:
>>>
>>> Using:
>>>
>>> MaxClients 15
>>> ServerLimit 15
>>>
>>> Using ab like this:
>>>
>>> while true; do /usr/local/apache2/bin/ab -c 14 -n 5000
>>> http://127.0.0.1/server-status; done
>>>
>>> I get:
>>>
>>> slots: 15 CCCCCCCCCCCCCWC
>>>
>>> Then I gracefully restart apache using:
>>>
>>> MaxClients 5
>>> ServerLimit 15
>>>
>>> Then I get:
>>>
>>> slots: 5 WWCCR
>
> I'm asking, if those workers are spread across clients. I'm not altogether
> clear if those were reaped, or if they just happened to line up.
>
--
Jordi
Re: mod_status slots
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jordi Prats wrote:
> Hi all,
> There's any way to formally propose this littler change to mod_status?
>
> Jordi
>
> On Mon, Aug 11, 2008 at 9:57 AM, Jordi Prats <jo...@gmail.com> wrote:
>> On Fri, Aug 8, 2008 at 7:04 PM, William A. Rowe, Jr.
>> <wr...@rowe-clan.net> wrote:
>>> Jordi Prats wrote:
>>>> I don't know about other implications of changing this line. I've just
>>>> tested it using prefork both restarting and reloading apache. What do
>>>> you think about this little change?
>>> How's your proposed patch interact with a server using slots 1-16, 128-136
>>> when they gracefully restart the server with a lower number of maxclients?
>>>
>> It works fine. For example:
>>
>> Using:
>>
>> MaxClients 15
>> ServerLimit 15
>>
>> Using ab like this:
>>
>> while true; do /usr/local/apache2/bin/ab -c 14 -n 5000
>> http://127.0.0.1/server-status; done
>>
>> I get:
>>
>> slots: 15 CCCCCCCCCCCCCWC
>>
>> Then I gracefully restart apache using:
>>
>> MaxClients 5
>> ServerLimit 15
>>
>> Then I get:
>>
>> slots: 5 WWCCR
I'm asking, if those workers are spread across clients. I'm not altogether
clear if those were reaped, or if they just happened to line up.
Re: mod_status slots
Posted by Jordi Prats <jo...@gmail.com>.
Hi all,
There's any way to formally propose this littler change to mod_status?
Jordi
On Mon, Aug 11, 2008 at 9:57 AM, Jordi Prats <jo...@gmail.com> wrote:
> On Fri, Aug 8, 2008 at 7:04 PM, William A. Rowe, Jr.
> <wr...@rowe-clan.net> wrote:
>> Jordi Prats wrote:
>>>
>>> I don't know about other implications of changing this line. I've just
>>> tested it using prefork both restarting and reloading apache. What do
>>> you think about this little change?
>>
>> How's your proposed patch interact with a server using slots 1-16, 128-136
>> when they gracefully restart the server with a lower number of maxclients?
>>
>
> It works fine. For example:
>
> Using:
>
> MaxClients 15
> ServerLimit 15
>
> Using ab like this:
>
> while true; do /usr/local/apache2/bin/ab -c 14 -n 5000
> http://127.0.0.1/server-status; done
>
> I get:
>
> slots: 15 CCCCCCCCCCCCCWC
>
> Then I gracefully restart apache using:
>
> MaxClients 5
> ServerLimit 15
>
> Then I get:
>
> slots: 5 WWCCR
>
> regards
>
> --
> Jordi
>
--
Jordi
Re: mod_status slots
Posted by Jordi Prats <jo...@gmail.com>.
On Fri, Aug 8, 2008 at 7:04 PM, William A. Rowe, Jr.
<wr...@rowe-clan.net> wrote:
> Jordi Prats wrote:
>>
>> I don't know about other implications of changing this line. I've just
>> tested it using prefork both restarting and reloading apache. What do
>> you think about this little change?
>
> How's your proposed patch interact with a server using slots 1-16, 128-136
> when they gracefully restart the server with a lower number of maxclients?
>
It works fine. For example:
Using:
MaxClients 15
ServerLimit 15
Using ab like this:
while true; do /usr/local/apache2/bin/ab -c 14 -n 5000
http://127.0.0.1/server-status; done
I get:
slots: 15 CCCCCCCCCCCCCWC
Then I gracefully restart apache using:
MaxClients 5
ServerLimit 15
Then I get:
slots: 5 WWCCR
regards
--
Jordi
Re: mod_status slots
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jordi Prats wrote:
>
> I don't know about other implications of changing this line. I've just
> tested it using prefork both restarting and reloading apache. What do
> you think about this little change?
How's your proposed patch interact with a server using slots 1-16, 128-136
when they gracefully restart the server with a lower number of maxclients?