Re: Frontend not down

From: Willy Tarreau <w#1wt.eu>
Date: Tue, 29 Apr 2008 21:45:59 +0200


On Tue, Apr 29, 2008 at 02:08:14PM +0200, Maciej Bogucki wrote:
> > Why is not the frontend down too If all servers are down?.
> >
> > proxy1,FRONTEND,,,0,1,2000,4,0,76,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,
> > proxy1,server1,0,0,0,0,,0,0,0,,0,,0,0,0,,DOWN,10,1,0,0,1,123,123,,1,2,1,,0,
> > proxy1,server1,0,0,0,0,,0,0,0,,0,,0,0,0,,DOWN,10,1,0,0,1,118,118,,1,2,2,,0,
> > proxy1,BACKEND,0,0,0,0,2000,0,0,76,0,0,,0,0,0,0,DOWN,0,0,0,,1,118,118,,1,2,
> >
> >
> > I have haproy 1.3.14.4 <http://1.3.14.4>
>
> Why it should be? It is good behavior, because then it can send "503
> Service Unavailable" to the clients.

Exactly. The frontend state is either OPEN of CLOSED. OPEN means the socket is listening. CLOSED means it does not listen anymore, most likely because it is saturated with $maxconn connections.

Also, do not forget that having only one backend behind one frontend is just one usage case. Other people use more complex configurations.

If this is a problem for monitoring, you can take a look at the "monitor" keyword. It allows you to return OK/KO depending on an ACL, including the number of online servers in a backend. For instance, you could do something like this :

    acl proxy1_dead nbsrv(proxy1) eq 0
    monitor fail if proxy1_dead
    monitor uri /test

Then, requests sent to /test will either return 200 or 503 depending on the number of available servers in the backend. People also use that feature to switch over to another backend in case of failure.

> Best Regards
> Maciej Bogucki

Regards,
Willy Received on 2008/04/29 21:45

This archive was generated by hypermail 2.2.0 : 2008/04/29 22:01 CEST