tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Rossbach ...@objektpark.de>
Subject Missing support from busy worker at jk_lb_worker.find_best_bydomain
Date Sat, 18 Mar 2006 16:43:14 GMT
Hi,

Find that method find_best_bydomain not suppoprt the new busy lb  
strategy!

---
L252 jk_lb_worker.c

        /* Take into calculation only the workers that are
          * not in error state, stopped or not disabled.
          */
         if (JK_WORKER_USABLE(p->lb_workers[i].s)) {
             if (p->lbmethod == JK_LB_BYREQUESTS) {
                 p->lb_workers[i].s->lb_value += p->lb_workers[i].s- 
 >lb_factor;
                 total_factor += p->lb_workers[i].s->lb_factor;
                 if (!candidate || p->lb_workers[i].s->lb_value >  
candidate->s->lb_value)
                     candidate = &p->lb_workers[i];
             }
             else {
                 mytraffic = (p->lb_workers[i].s->transferred +
                              p->lb_workers[i].s->readed ) / p- 
 >lb_workers[i].s->lb_factor;
                 if (!candidate || mytraffic < curmin) {
                     candidate = &p->lb_workers[i];
                     curmin = mytraffic;
                 }
             }
         }


=====

Can we use this at line
L:351
                mytraffic = (p->lb_workers[i].s->transferred +
                              p->lb_workers[i].s->readed ) / p- 
 >lb_workers[i].s->lb_factor;

instead
            mytraffic = (p->lb_workers[i].s->transferred/p->lb_workers 
[i].s->lb_factor) +
                         (p->lb_workers[i].s->readed/p->lb_workers 
[i].s->lb_factor);

Better we extract the small redundant value calculations at separate  
functions!

Regards Peter




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message