Bug 36895

Summary: get_most_suitable_worker is called twice for a single request
Product: Tomcat Connectors Reporter: Bibin Abraham <bibin.abraham>
Component: CommonAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Bibin Abraham 2005-10-03 14:33:12 UTC
The function get_most_suitable_worker in jk_lb_worker.c is called twice for each
request. jk_handler selects the worker returned from the first called function .
So loadbalancing is not perfect. ( in mod_jk version 1.2.14 ) 

 Consider we have two loadbalancer workers tomcat1 and tomcat2 . 

  request1 --> jk_handler <-- tomcat1 ( returned from get_most_suitable_worker) 
                          <-- tomcat2 ( returned from get_most_suitable_worker) 

  request2 --> jk_handler <-- tomcat1 ( returned from get_most_suitable_worker) 
                          <-- tomcat2 ( returned from get_most_suitable_worker)
  
   Here jk_handler always selects tomcat1.

  If we have 3 loadbalancer workers, the sequence will be like this....

   request1 --> jk_handler <-- tomcat1   
                           <-- tomcat2  

   request2 --> jk_handler <-- tomcat3   
                           <-- tomcat1 

   request3 --> jk_handler <-- tomcat2   
                           <-- tomcat3

  Here the loadbalancing sequence will be ... tomcat1,tomcat3,tomcat2,tomcat1.....
Comment 1 Bibin Abraham 2005-10-15 15:21:38 UTC
The request for each web page also contains another request for favicon.ico . So
each request appeares as two requests . One is the request for web page and the
other for favicon.ico.