Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 8159 invoked from network); 31 Jul 2006 19:36:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jul 2006 19:36:32 -0000 Received: (qmail 867 invoked by uid 500); 31 Jul 2006 19:36:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 800 invoked by uid 500); 31 Jul 2006 19:36:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 789 invoked by uid 99); 31 Jul 2006 19:36:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jul 2006 12:36:27 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 31 Jul 2006 12:36:26 -0700 Received: (qmail 8106 invoked by uid 2161); 31 Jul 2006 19:36:06 -0000 Received: from [192.168.2.4] (euler.heimnetz.de [192.168.2.4]) by cerberus.heimnetz.de (Postfix on SuSE Linux 7.0 (i386)) with ESMTP id 132B21721C for ; Mon, 31 Jul 2006 21:35:50 +0200 (CEST) Message-ID: <44CE5B9D.2030708@apache.org> Date: Mon, 31 Jul 2006 21:35:57 +0200 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: de, en, de-de, en-gb, cy, zu, xh MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r427172 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/mod_proxy_balancer.c References: <20060731170141.DF4EF1A981A@eris.apache.org> In-Reply-To: <20060731170141.DF4EF1A981A@eris.apache.org> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 07/31/2006 07:01 PM, jim@apache.org wrote: > Author: jim > Date: Mon Jul 31 10:01:40 2006 > New Revision: 427172 > > URL: http://svn.apache.org/viewvc?rev=427172&view=rev > Log: > Add in a very simple balancer "set" concept, which allows > for members to be assigned to a particular cluster set > such that members in lower-numbered sets are checked/used > before those in higher ones. > > Also bundled in this are some HTML cleanups for the balancer > manager UI. Sorry for the mixins :) > > Compiles/builds clean: passes test framework as well > as more normal usage tests ;) > > + do { > + while (!mycandidate && !checked_standby) { > + worker = (proxy_worker *)balancer->workers->elts; > + for (i = 0; i < balancer->workers->nelts; i++, worker++) { > + if (!checking_standby) { /* first time through */ > + if (worker->s->lbset > max_lbset) > + max_lbset = worker->s->lbset; > + } > + if (worker->s->lbset > cur_lbset) > + continue; > + if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(worker) : PROXY_WORKER_IS_STANDBY(worker)) ) > + continue; > + /* If the worker is in error state run > + * retry on that worker. It will be marked as > + * operational if the retry timeout is elapsed. > + * The worker might still be unusable, but we try > + * anyway. > + */ > + if (!PROXY_WORKER_IS_USABLE(worker)) > + ap_proxy_retry_worker("BALANCER", worker, r->server); > + /* Take into calculation only the workers that are > + * not in error state or not disabled. > + */ > + if (PROXY_WORKER_IS_USABLE(worker)) { > + mytraffic = (worker->s->transferred/worker->s->lbfactor) + > + (worker->s->read/worker->s->lbfactor); > + if (!mycandidate || mytraffic < curmin) { > + mycandidate = worker; > + curmin = mytraffic; > + } > } > } > + checked_standby = checking_standby++; > } > - checked_standby = checking_standby++; > - } > + cur_lbset++; > + } while (cur_lbset < max_lbset && !mycandidate); Shouldn't that be "while (cur_lbset <= max_lbset && !mycandidate);" (same question also for the other algorithm)? I guess otherwise we would not check for the workers with the lbset max_lbset. Regards RĂ¼diger