> 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 [EMAIL PROTECTED]
Covalent Technologies [EMAIL PROTECTED]
-----------------------------------------------------------------------------