Re: Using acls to check if # connections less than number of up servers

From: Willy Tarreau <>
Date: Sun, 12 Apr 2009 12:56:09 +0200

On Tue, Apr 07, 2009 at 02:58:27PM -0700, Karl Pietri wrote:
> Hey all I'm trying to use Acls to have a priority queue of servers for a
> special ip/port and fail over to the regular section and i'm wondering if
> its possible to have an acl that would check if dst_conn gt nbsrv(backend);
> the code works fine as it is, but if one server is down in the priority
> farm then the check to send it to the bigger farm doesn't pass properly as
> its checking for 3 not 2. Any help would be appreciated. The section of
> code is copied below showing what i currently have.

I think that what you want can be achieved using connslots. Your frontend config would look approximately like this :

frontend internal_api_rails_farm

    mode http
    option forwardfor
    acl priority_full connslots(priority_rails_farm) eq 0     acl priority_down nbsrv(priority_rails_farm) lt 1     use_backend rails_farm if priority_full or priority_down     default_backend priority_rails_farm

You need 1.3.17 to use connslots though.

Willy Received on 2009/04/12 12:56

This archive was generated by hypermail 2.2.0 : 2009/04/12 13:00 CEST