Welcome! Log In Create A New Profile

Advanced

bind keyword

Posted by Damien Churchill 
Damien Churchill
bind keyword
June 15, 2012 02:00PM
Hi,

In the documentation for 1.4.18 in the keyword matrix it states that
the bind configuration keyword is only valid within listen or frontend
sections. However I've created a backend section that not only allows
the keyword, but also creates a socket (which doesn't seem to respond
to any requests). Is this a bug or is it intentional? I've included
the backend snippet to look at.

backend some-backend-name
balance roundrobin
timeout check 10000
bind :1557

server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
option httpchk HEAD / HTTP/1.1\r\nHost:localhost

Regards,
Damien
Willy Tarreau
Re: bind keyword
June 18, 2012 09:10AM
Hi Damien,

On Fri, Jun 15, 2012 at 12:53:48PM +0100, Damien Churchill wrote:
> Hi,
>
> In the documentation for 1.4.18 in the keyword matrix it states that
> the bind configuration keyword is only valid within listen or frontend
> sections. However I've created a backend section that not only allows
> the keyword, but also creates a socket (which doesn't seem to respond
> to any requests). Is this a bug or is it intentional? I've included
> the backend snippet to look at.
>
> backend some-backend-name
> balance roundrobin
> timeout check 10000
> bind :1557
>
> server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
> option httpchk HEAD / HTTP/1.1\r\nHost:localhost

Huh! this is clearly a bug ! I confirm it's still present in 1.5-dev11.
It's amazing nobody ever encountered it before! It's nasty because the
connection is accepted to the listening port, but nothing is done on it
(it's not polled), so the connection remains in CLOSE_WAIT when the
client leaves. I also suspect that this would prevent a soft restart
from doing its job. I have to fix this !

Thanks for this useful report !
Willy
Damien Churchill
Re: bind keyword
June 20, 2012 05:30PM
Hi Willy,

On 18 June 2012 08:07, Willy Tarreau <[email protected]> wrote:
>
> Thanks for this useful report !
> Willy
>

My pleasure, thanks for the great piece of software!

I've found another place where the behaviour appears to diverge from
the documentation. At the beginning of section 4 it says that it's
mandatory that proxies with overlapping capabilities have different
names. My interpretation of that is that frontends can't have the same
name, and neither can backends, however a frontend may share a name
with a backend, is that correct? I ask as it seems I'm able to (at
least with 1.4.18) create multiple instances of front and backends
with overlapping names.

Config extract:

backend some-backend-name
balance roundrobin
timeout check 10000

server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
option httpchk HEAD / HTTP/1.1\r\nHost:localhost

backend some-backend-name
balance roundrobin
timeout check 10000

server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
option httpchk HEAD / HTTP/1.1\r\nHost:localhost

frontend test-frontend
bind :19001

frontend test-frontend
bind :19002

Is this me misinterpreting how things should work or something else going on?

Regards,
Damien
Willy Tarreau
Re: bind keyword
June 20, 2012 08:50PM
Hi Damien,

On Wed, Jun 20, 2012 at 04:19:09PM +0100, Damien Churchill wrote:
> I've found another place where the behaviour appears to diverge from
> the documentation. At the beginning of section 4 it says that it's
> mandatory that proxies with overlapping capabilities have different
> names. My interpretation of that is that frontends can't have the same
> name, and neither can backends, however a frontend may share a name
> with a backend, is that correct? I ask as it seems I'm able to (at
> least with 1.4.18) create multiple instances of front and backends
> with overlapping names.
>
> Config extract:
>
> backend some-backend-name
> balance roundrobin
> timeout check 10000
>
> server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
> option httpchk HEAD / HTTP/1.1\r\nHost:localhost
>
> backend some-backend-name
> balance roundrobin
> timeout check 10000
>
> server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
> option httpchk HEAD / HTTP/1.1\r\nHost:localhost
>
> frontend test-frontend
> bind :19001
>
> frontend test-frontend
> bind :19002
>
> Is this me misinterpreting how things should work or something else going on?

Your interpretation is right, but I think you didn't read the warnings
that are emitted when starting the service :

[WARNING] 171/204356 (2413) : Parsing [overlap.cfg:27]: backend 'some-backend-name' has same name as another backend (declared at overlap.cfg:20).
[WARNING] 171/204356 (2413) : Parsing [overlap.cfg:37]: frontend 'test-frontend' has same name as another frontend (declared at overlap.cfg:34).

Nothing prevents the config from working, but some features will not
reliably work with such a conf (eg: ACLs referencing a backend name).
Hence the warning.

Regards,
Willy
Damien Churchill
Re: bind keyword
June 21, 2012 10:20AM
Hi Willy,

On 20 June 2012 19:44, Willy Tarreau <[email protected]> wrote:
> Hi Damien,
>
> On Wed, Jun 20, 2012 at 04:19:09PM +0100, Damien Churchill wrote:
>> I've found another place where the behaviour appears to diverge from
>> the documentation. At the beginning of section 4 it says that it's
>> mandatory that proxies with overlapping capabilities have different
>> names. My interpretation of that is that frontends can't have the same
>> name, and neither can backends, however a frontend may share a name
>> with a backend, is that correct? I ask as it seems I'm able to (at
>> least with 1.4.18) create multiple instances of front and backends
>> with overlapping names.
>>
>> Config extract:
>>
>> backend some-backend-name
>>     balance roundrobin
>>     timeout check 10000
>>
>>     server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
>>     option httpchk HEAD / HTTP/1.1\r\nHost:localhost
>>
>> backend some-backend-name
>>     balance roundrobin
>>     timeout check 10000
>>
>>     server localhost 127.0.0.1:80 weight 1 check inter 2000 fall 3
>>     option httpchk HEAD / HTTP/1.1\r\nHost:localhost
>>
>> frontend test-frontend
>>     bind :19001
>>
>> frontend test-frontend
>>     bind :19002
>>
>> Is this me misinterpreting how things should work or something else going on?
>
> Your interpretation is right, but I think you didn't read the warnings
> that are emitted when starting the service :
>
> [WARNING] 171/204356 (2413) : Parsing [overlap.cfg:27]: backend 'some-backend-name' has same name as another backend (declared at overlap.cfg:20).
> [WARNING] 171/204356 (2413) : Parsing [overlap.cfg:37]: frontend 'test-frontend' has same name as another frontend (declared at overlap.cfg:34).
>
> Nothing prevents the config from working, but some features will not
> reliably work with such a conf (eg: ACLs referencing a backend name).
> Hence the warning.
>

Okay thanks, it's good to know the expected behaviour.

I see the warnings now, I had 'quiet' in the configuration which was
suppressing them, my mistake!

Thanks,
Damien
Sorry, only registered users may post in this forum.

Click here to login