Hi Willy, thank you for your suggestion. A first view let me think the same as you: A little bit ugly.
Is there a way to dynamically check the saturation of a backend server? Like the work of Simon Horman? It should be quit easy to query an apache status to calculate a kind of "idleness" of that. Best regards Andreas --- drumedar Internet-Entwicklungs-GmbH [email protected] http://www.drumedar.de Heisinger Strasse 12 D-87437 Kempten (Allgäu) Fon: +49 (831) 5758-215 Fax: +49 (831) 5758-216 Geschäftsführer: Dipl.Inf.(FH) Andreas Steidle, Rüdiger Hartmann, Dipl.Kfm.(Univ.) Andreas Mock Registergericht: Amtsgericht Kempten (Allgäu) Registernummer: HRB 8626 Ust-IdNr.: DE 206335502 -----Ursprüngliche Nachricht----- Von: Willy Tarreau [mailto:[email protected]] Gesendet: Dienstag, 3. September 2013 08:01 An: Andreas Mock Cc: [email protected] Betreff: Re: Limits for physical server Hi Andreas, On Mon, Sep 02, 2013 at 09:15:14AM +0000, Andreas Mock wrote: > Hi all, > > I'm not sure if the following is doable: > > I have several servers (processes providing services) on > one physical server. Is there a way to limit the count > of connections for the physical server? > > backend num1 > server1 IP:Port1 > server2 IP:Port1 > backend num2 > server1 IP:Port2 > server2 IP:Port2 > > And I want to limit resources based on > the entities server1, server2 while sharing > their resources among the backends. This was an old request we had in the past, even before the split into frontend+backend. The question came from hosting providers relying on virtual hosting on the same server component (eg: apache configured with virtual hosts). But this mechanism was impossible to implement by then. Then the request has almost disappeared and nobody has been working on this. 1.6 should make this possible along with many other things with the ability to wait on a resource (server's connection count being one of these). At the moment I don't have any simple solution to propose. One method could be to chain two haproxy instances but I find this a bit ugly : frontend front use_backend num1 if { hdr(host) num1 } use_backend num2 if { hdr(host) num2 } backend num1 server1 127.0.0.1:Port1 check server2 127.0.0.2:Port1 check backend num2 server1 127.0.0.1:Port2 check server2 127.0.0.2:Port2 check listen server1 bind 127.0.0.1:port1 bind 127.0.0.1:port2 server server1 $IP maxconn 1000 # no port, no check listen server2 bind 127.0.0.2:port1 bind 127.0.0.2:port2 server server2 $IP maxconn 1000 # no port, no check etc... As you can see this will concentrate all connections for physical server "server1" into a single proxy with a common maxconn setting for all ports. It can do exactly what you want, but I tend to find this a bit ugly! Willy

