You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2009/04/27 17:02:40 UTC

svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Author: jim
Date: Mon Apr 27 15:02:40 2009
New Revision: 769020

URL: http://svn.apache.org/viewvc?rev=769020&view=rev
Log:
Fold in initial template for methods to be able to
reset (initialize) and "age" their data, useful when
adding new workers, or when workers come back into
the fold....

Logic and code to come in a bit :)

Modified:
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c Mon Apr 27 15:02:40 2009
@@ -105,10 +105,20 @@
 
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bybusyness =
 {
     "bybusyness",
     &find_best_bybusyness,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c Mon Apr 27 15:02:40 2009
@@ -132,6 +132,14 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 /*
  * How to add additional lbmethods:
  *   1. Create func which determines "best" candidate worker
@@ -142,6 +150,8 @@
 {
     "byrequests",
     &find_best_byrequests,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c Mon Apr 27 15:02:40 2009
@@ -105,10 +105,20 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bytraffic =
 {
     "bytraffic",
     &find_best_bytraffic,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c Mon Apr 27 15:02:40 2009
@@ -299,10 +299,20 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method heartbeat =
 {
     "heartbeat",
     &find_best_hb,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Apr 27 15:02:40 2009
@@ -390,6 +390,8 @@
     const char *name;            /* name of the load balancer method*/
     proxy_worker *(*finder)(proxy_balancer *balancer,
                             request_rec *r);
+    apr_status_t (*reset)(proxy_balancer *balancer, request_rec *r);
+    apr_status_t (*age)(proxy_balancer *balancer, request_rec *r);
     void            *context;   /* general purpose storage */
 };
 

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Apr 27 15:02:40 2009
@@ -2346,6 +2346,8 @@
             worker->hostname);
     }
     else {
+        if (worker->s->retries) {
+        }
         worker->s->error_time = 0;
         worker->s->retries = 0;
     }



Re: svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 04/27/2009 05:02 PM, jim@apache.org wrote:
> Author: jim
> Date: Mon Apr 27 15:02:40 2009
> New Revision: 769020
> 
> URL: http://svn.apache.org/viewvc?rev=769020&view=rev
> Log:
> Fold in initial template for methods to be able to
> reset (initialize) and "age" their data, useful when
> adding new workers, or when workers come back into
> the fold....
> 
> Logic and code to come in a bit :)
> 
> Modified:
>     httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
>     httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
>     httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
>     httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
>     httpd/httpd/trunk/modules/proxy/mod_proxy.h
>     httpd/httpd/trunk/modules/proxy/proxy_util.c
> 

> 
> Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=769020&r1=769019&r2=769020&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
> +++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Apr 27 15:02:40 2009
> @@ -2346,6 +2346,8 @@
>              worker->hostname);
>      }
>      else {
> +        if (worker->s->retries) {
> +        }

What will be the purpose of this?

Regards

RĂ¼diger

Re: svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
On May 1, 2009, at 4:50 AM, jean-frederic clere wrote:

> Jim Jagielski wrote:
>> On Apr 30, 2009, at 4:04 AM, jean-frederic clere wrote:
>>> jim@apache.org wrote:
>>>> Author: jim
>>>> Date: Mon Apr 27 15:02:40 2009
>>>> New Revision: 769020
>>>> URL: http://svn.apache.org/viewvc?rev=769020&view=rev
>>>> Log:
>>>> Fold in initial template for methods to be able to
>>>> reset (initialize) and "age" their data, useful when
>>>> adding new workers, or when workers come back into
>>>> the fold....
>>>> Logic and code to come in a bit :)
>>>
>>> In fact the reset() allow to create the worker but we will still  
>>> create it in the mod_proxy_balancer, correct?
>>>
>> Yes... plus, reset means different things to each balancer, since  
>> they
>> use different vars for tracking
>
> So the reset is going to be call in the add_member() just after  
> ap_proxy_add_worker_to_balancer() correct?
>
> +++
> runtime->id = proxy_lb_workers;
> proxy_lb_workers++;
> +++
> In fact prevents that reset() to be able to generate id for worker.
> In mod_cluster for example I have a saved configuration of worker  
> and I am restoring on cold restart I would like the id to be the  
> slotmem id, does it make sense to move the id generation to the  
> reset()?
>

+1... makes sense.

Re: svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Posted by jean-frederic clere <jf...@gmail.com>.
Jim Jagielski wrote:
> 
> On Apr 30, 2009, at 4:04 AM, jean-frederic clere wrote:
> 
>> jim@apache.org wrote:
>>> Author: jim
>>> Date: Mon Apr 27 15:02:40 2009
>>> New Revision: 769020
>>> URL: http://svn.apache.org/viewvc?rev=769020&view=rev
>>> Log:
>>> Fold in initial template for methods to be able to
>>> reset (initialize) and "age" their data, useful when
>>> adding new workers, or when workers come back into
>>> the fold....
>>> Logic and code to come in a bit :)
>>
>> In fact the reset() allow to create the worker but we will still 
>> create it in the mod_proxy_balancer, correct?
>>
> 
> Yes... plus, reset means different things to each balancer, since they
> use different vars for tracking

So the reset is going to be call in the add_member() just after 
ap_proxy_add_worker_to_balancer() correct?

+++
runtime->id = proxy_lb_workers;
proxy_lb_workers++;
+++
In fact prevents that reset() to be able to generate id for worker.
In mod_cluster for example I have a saved configuration of worker and I 
am restoring on cold restart I would like the id to be the slotmem id, 
does it make sense to move the id generation to the reset()?

Cheers

Jean-Frederic

> 
> 


Re: svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 30, 2009, at 4:04 AM, jean-frederic clere wrote:

> jim@apache.org wrote:
>> Author: jim
>> Date: Mon Apr 27 15:02:40 2009
>> New Revision: 769020
>> URL: http://svn.apache.org/viewvc?rev=769020&view=rev
>> Log:
>> Fold in initial template for methods to be able to
>> reset (initialize) and "age" their data, useful when
>> adding new workers, or when workers come back into
>> the fold....
>> Logic and code to come in a bit :)
>
> In fact the reset() allow to create the worker but we will still  
> create it in the mod_proxy_balancer, correct?
>

Yes... plus, reset means different things to each balancer, since they
use different vars for tracking


Re: svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c

Posted by jean-frederic clere <jf...@gmail.com>.
jim@apache.org wrote:
> Author: jim
> Date: Mon Apr 27 15:02:40 2009
> New Revision: 769020
> 
> URL: http://svn.apache.org/viewvc?rev=769020&view=rev
> Log:
> Fold in initial template for methods to be able to
> reset (initialize) and "age" their data, useful when
> adding new workers, or when workers come back into
> the fold....
> 
> Logic and code to come in a bit :)
> 

In fact the reset() allow to create the worker but we will still create 
it in the mod_proxy_balancer, correct?

Cheers

Jean-Frederic