We have a tomcat cluster with a load balancer (haproxy). As part of our upgrade script we would like to starve a single tomcat in the cluster of 3, wait until all the requests are handled for that particular tomcat. and only then we would like to shut it down and upgrade the web application running on that tomcat.
Our question is:
How can our script indicate if the tomcat is fully starved (all request have been taken cared of)?
Is there an API the tomcat itself exposes? or maybe we can query haproxy for that info?
EDIT: Here is my haproxy configuration file:
global debug stats socket /etc/haproxy/haproxysock level admin defaults mode http timeout connect 5s timeout queue 300s timeout client 300s timeout server 300s frontend http-in bind *:8080 default_backend NG backend NG cookie JSESSIONID prefix server 10.0.110.44 10.0.110.44:8080 cookie JSESSIONID_SERVER_1 check maxconn 500 server 10.0.110.45 10.0.110.45:8080 cookie JSESSIONID_SERVER_2 check maxconn 500 #server 10.0.110.41 10.0.110.41:8080 cookie JSESSIONID_SERVER_3 check maxconn 500 option httpclose option forwardfor balance roundrobin option redispatch retries 15 listen admin bind *:8081 stats enable stats refresh 1s