I am using HAProxy in front of 2 webapps deployed in tomcat. When testing High Availability, I made 10000 requests and at some point I kill one of the tomcat instances. For 1 or 2 requests I get some errors. My request are sent using Spring's RestTemplate. Here is the exception: "org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://:8080/myservice/_doaction":Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server"
The HAProxy stats says in the "Errors" section, "Resp" subsection, when I hover over the number shown there, which is 2 : "Connection resets during transfers:1 client, 2 servers". What this means?
Also, on the "Warnings" section I have "Retr":29 and "Redis":1. This tells me that the request is being redispatched to a "living" server. Is this assumption correct?
Here is the haproxy.cfg:
listen tomcat_frontend
bind *:8080
timeout client 5000ms
timeout server 5000ms
mode http
option httpclose
option httplog
acl myservice_tomcat path_beg /myservice
use_backend tomcat_myservice_backend if myservice_tomcat
backend tomcat_myservice_backend
option forwardfor
option redispatch
retries 30
server server-2 :8080 check inter 10
server server-1 :8080 check inter 10
balance leastconn
mode http