Bug 36895 - get_most_suitable_worker is called twice for a single request
Summary: get_most_suitable_worker is called twice for a single request
Status: CLOSED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-03 14:33 UTC by Bibin Abraham
Modified: 2008-10-05 03:09 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.