Haproxy Accepting and Dropping connections

HI there

i have this problem when trying to load a tcp connection from a .exe with a login
everytime i try to login it either halts, drops, or accepts the connection

around 15 ppl login to this application and sometimes it works and some times it does not
i have to login about 4-5 times with the same username/password and it drops the other 3

can someone tell me what im doing wrong here

defaults
mode tcp
retries 0
maxconn 2000
timeout connect 1s
timeout client 30s
timeout server 30s
frontend WoW_Port
tcp-request session accept if { src_sess_rate gt 10 }

bind *:3724
bind *:8085
bind *:1119
bind *:8081
default_backend backend_servers

backend backend_servers
balance roundrobin

server          node01 IP ADDRESS
server          node02 IP ADDRESS

Ah… this looks like a World of Warcraft private server or something very close to it. I am a fan! :wink: If so, those are stateful and do not like rotating connections. You need to make them “sticky”, meaning when a client connects to a backend server, they “stick” with that backend server as long as the are connected and the server is up. I would probaby setup your backend in one of these two methods.
DISCLAIMER: I have not personally done either of these, and I would proabalby prefer the “failover” setup over the sticky balance setup…

  1. Sticky Balance Setup:
backend backend_servers
    balance source
    hash-type consistent

    server    node01 IP ADDRESS check port 3724
    server    node02 IP ADDRESS check port 3724

Source: Implementing TCP Sticky Sessions With HAProxy to Handle SSL Pass-through Traffic - Server Fault

  1. Failover Setup:

I would proably do something like this instead. This uses only one server unless it goes down. If it does, all new connections move over to the new server. The problem with this setup is that you will have to have a separate backend for each port

backend backend_servers
    server    node01 IP ADDRESS check port 3724
    server    node02 IP ADDRESS check port 3724 backup

Note: I added check port 3724 to each of your servers. The idea is that HAProxy should poll some port peridically to see if that server is up or not. Without this, HAProxy will gladly attempt to send traffic to a server that is down or for whatever reason cannot accept traffic only to return your end-user a gateway timeout.

Please test these out. If neither work for your use case, please respond with what specifically is missing.

This appears to only allow access after 10 sessions come in very quickly? Can you explain what you mean to accomplish with this setting?

If fixes the drop and hang but when i log in and go to realm select it just says system unavilable this is what i have now

defaults
mode tcp
timeout connect 1s
timeout client 500s
timeout server 500s
frontend WoW_Port
stick-table type ip size 50k expire 5h
stick on src
bind *:3724
bind *:8085
bind *:1119
bind *:8081
default_backend backend_servers

backend backend_servers
balance source
hash-type consistent

server          node01 193.70.*.*:3724 check port 3724
server          node02 193.70.*.*:8085 check port 8085

it actually fixed the drop and hang time but now i think the sticky isnt storing any of the data

I think it’s a port setting problem. Either both nodes are meant to handle only one port or all ports. What you have in the last reply says that HAProxy will always send traffic to node01 on port 3724 even if it came in on 8085 or any other port, and it will always send traffic to node02 on port 8085 even if it came in on 3724 or any other port. If these two nodes are truly handling two different ports (like, one is the world and the other is auth), then they need to be separated. Below is how my setup is in my HAProxy config, but I’m using an instance for auth and a seeparate instance for the world. My setup combines the frontends and backends with a single “listen” for each:

listen wow_auth
	bind *:3724 name "WoW Auth Service"
	mode tcp
	timeout client 600000
	timeout server 600000
	option tcpka
	option tcplog
	server wowhost 10.0.2.20:3724 check

listen wow_world
	bind *:8085 name "WoW World Service"
	mode tcp
	timeout client 600000
	timeout server 600000
	option tcpka
	option tcplog
	server wowhost 10.0.2.30:8085 check

If in your setup any node can receive on any port, please configure your backend this way:

backend backend_servers
    balance source
    hash-type consistent
    server    node01 193.70.80.11 check port 8085
    server    node02 193.70.80.12 check port 8085 

This assumes HAProxy can consider these nodes “up and ready” if they respond on 8085. (If I recall, auth must be up before world can be up, so if world is up, they’re both up.) They will still receive traffic on other ports. If you’d rather check on 3724, then use that instead.

Edit: Clarifying last part.