httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GUMMALAM,MOHAN (HP-Cupertino,ex2)" <mohan_gumma...@hp.com>
Subject RE: httpd-2.0 tagged (some analysis)
Date Thu, 28 Jun 2001 23:23:51 GMT
That seems to work fine on HP-UX 11.0..  I'll get back on the results on IPF
(or IA64).
M

-----Original Message-----
From: rbb@covalent.net [mailto:rbb@covalent.net]
Sent: Thursday, June 28, 2001 2:57 PM
To: new-httpd@apache.org
Subject: Re: httpd-2.0 tagged (some analysis)



> This loop...
> ************************
>   for (i = 0; i < ap_daemons_limit; ++i) {
>      /* Initialization to satisfy the compiler. It doesn't know
>       * that ap_threads_per_child is always > 0 */
>     int status = SERVER_DEAD;
>     int any_dying_threads = 0;
>     int idle_thread_addition = 0;
>
>     if (i >= ap_max_daemons_limit && free_length == idle_spawn_rate)
>         break;
>     for (j = 0; j < ap_threads_per_child; j++) {
>         ws = &ap_scoreboard_image->servers[i][j];
>         status = ws->status;
>
>         any_dying_threads = any_dying_threads || (status ==
SERVER_GRACEFUL);
>
>        /* We consider a starting server as idle because we started it
>         * at least a cycle ago, and if it still hasn't finished starting
>         * then we're just going to swamp things worse by forking more.
>         * So we hopefully won't need to fork more if we count it.
>         * This depends on the ordering of SERVER_READY and
SERVER_STARTING.
>         */
>        if (status <= SERVER_READY) {
>            ++idle_thread_addition;
>        }
>     }
>     if (any_dying_threads && free_length < idle_spawn_rate) {
>         free_slots[free_length] = i;
>         ++free_length;
>     }
>     if (!any_dying_threads) {
>             last_non_dead = i;
>           ++total_non_dead;
>         idle_thread_count += idle_thread_addition;
>      }
>   }
>    ap_max_daemons_limit = last_non_dead + 1;
>
>     if (idle_thread_count > max_spare_threads) {
>
> ************************
>
> results in idle_thrad_count to stablize at ap_max_daemons_limit *
ap_threads_per_child,
> which will generally be greater than max_spare_threads which causes the
pod write. I don't
> understand you algorithm so I've not figured out how to fix.

>From looking at this, I believe this is easily fixed by just changing that
last line to:

     if (idle_thread_count > max_spare_threads * ap_max_daemons_limit) {

But I need to check on that.

Ryan
____________________________________________________________________________
_
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
----------------------------------------------------------------------------
-

Mime
View raw message