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.....
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.