0

There are 4 elastic search nodes in a cluster and these 4 nodes are setup behind haproxy. Each of the node in the cluster is receiving around 900 to 1000 tcp connections, but one of the node has very less around 400 connections. Following is the configuration of ES node in the haproxy.cfg file

listen es-cluster
        bind *:9200
        mode tcp 
        option tcpka
        option tcplog
        balance leastconn
        #balance roundrobin
        timeout client  30m 
        timeout server  30m 
        server host1 xxx.xxx.xxx.xxx:9200 check weight 100 
        server host2 aaa.aaa.aaa.aaa:9200 check weight 65
        server host3 bbb.bbb.bbb.bbb:9200 check weight 150 
        server host4 ccc.ccc.ccc.ccc:9200 check weight 100
        server host5 ddd.ddd.ddd.ddd:9200 check weight 100

host3 has got very few tcp connections. I was using roundrobin in the begining. Due to more number of connections on one of the node, I changed the configuration to leastconn with weights and increased the weight for node host3. Still the number of TCP connection on node `host3' is very less. What further changes can be made in order for all the nodes to have equal number of connections

  • It's possible that host3 is simply very fast at processing the requests so that even though it actually is handling much more requests than the rest, at a given time you see less active connections. – wurtel Nov 13 '19 at 08:04
  • but all the servers have the same hardware architecture. The problem I am facing is `host2` which has the least weight has got the highest number of TCP connections when compared to other hosts. We have set an alert wherein when the TCP connections are more than 1100 it will send and alert. Currently the tcp connections for host2 is higher – user11549576 Nov 13 '19 at 08:19
  • What are the numbers in the `stats` page of HAProxy? – zeronone Nov 14 '19 at 12:55
  • @zeronone what numbers are you referring to? – user11549576 Nov 17 '19 at 03:11
  • I meant the number of TCP connections. HAProxy `/stats` page shows exactly how fairly TCP connections were distributed to each server over time, and how many are active currently. – zeronone Nov 17 '19 at 03:16
  • I hope this is the information you are looking for ``` host1 current session-rate 0, current session is 29``` ```host2 current session-rate 0, current sessions is 19``` ```host3 current session-rate 1, current sessions is 42``` ```host4 current session-rate 0, current sessions is 28``` ```host5 current session-rate 0, current sessions is 29 ``` – user11549576 Nov 17 '19 at 06:23
  • can somebody help me on this – user11549576 Nov 22 '19 at 05:17

0 Answers0