My set up is with one client node and two back end nodes and a HAProxy server sitting between the client node and the back end nodes. The client node sends requests to the HAProxy and my expectation is the requests will be load balanced as per below configuration. Which is first request goes to server1 and the next one goes to server2 and so on.
backend tcp_back
mode tcp
balance roundrobin
option tcp-check
tcp-check connect
option tcpka
timeout connect 500
timeout client 50000
timeout server 50000
server server1 10.10.10.1:3001 check
server server2 10.10.10.2:3001 check
But the problem is if I send back to back requests from my client node, all of those requests will end up in one backend server. But if I wait for some time ( I believe if I let the session expire by waiting for the timeout server setting) and then make a request, it will go to the second server. Could some one explain what happens here?