Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just started using HAProxy, and I am building a real-time chat application. I wonder if it is possible to send clients to another backend when the current backend reaches its maxconn (I am using "balance source"). Because sometimes, when a backend reaches its limit, all the connections to that backend are queued and the browser keeps loading while other backends are free.

share|improve this question
up vote 0 down vote accepted

I don't know, but try this in the backend configuration (adapt 10 with your maxconn) :

acl too_many be_sess_rate gt 10
use_backend b_too_many if too_many be_sess_rate
share|improve this answer

Try this, it will use another backend if current connection on frontend is greater than 20, change the number (line no 4) to suit with your needs, also I write mode tcp, you can change it to http if you need http load balance

frontend frontend_chat
    mode tcp
    balance roundrobin
    acl max_conn_reached fe_conn gt 20
    default_backend be_chat1
    use_backend be_chat1_and_chat2 if max_conn_reached

backend be_chat1
    mode tcp
    balance roundrobin
    server chat1 check maxconn 10

backend be_chat1_and_chat2
    mode tcp
    balance roundrobin
    server chat1 check maxconn 10
    server chat2 check maxconn 10
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.