Hi Frank,
My problem: The weight setting for a backend seems to be ignored when the > max concurrent session setting is reached. I was expecting the connection > to get queued for this backend but it seems to flip over to the host that > has connections available. > This is expected. The queue manager starts working as soon as at least one server as reached its maxconn. It has The weight is taken into account by the load-balancing algorithm, but since the queue manager has precedence over it. Hence as soon as a server has reached its maxconn, it is excluded from the load-balancing algorithm. Then the relative weight of the remaining server is applied. > I simplified my setup to 2 backend smtp servers, one with weight 100, the > other with weight 1. The max connection setting is set to 2. I'm opening > multiple SMTP connections simultaneously to this haproxy server. Attached > screenshot from haproxy stats shows that backend with weight 1 gets way too > many sessions. > > Increasing max concurrent sessions to 5 or more seem to prevent this > behavior, but I'm not totally sure about this. > The question is "Why do you need a maxconn to 2 on your servers?" > I would like to have only a small fraction (100:1) of requests go to the > backend with the lower weight and wonder how to do this correctly. It's > more important to me to have a defined distribution of connections going to > backends than answering requests as quickly as possible regardless of what > backend is used. > > the weight is the good way to go, simply increase your maxconn, unless there is a good reason for it to be as low as 2. Baptiste