Re: Multiple outgoing addresses for squid?

From: Eliezer Croitoru <eliezer_at_ngtech.co.il>
Date: Tue, 03 Apr 2012 04:56:20 +0300

On 30/03/2012 16:28, Chris Ross wrote:
>
> On Mar 29, 2012, at 8:45 PM, Robert Collins wrote:
>> 2012/3/30 Henrik Nordström<henrik_at_henriknordstrom.net>:
>>>> Can tcp_outgoing_address take multiple addresses now? Does it just round-robin through them?
>>>
>>> It can only select one per request at the moment.
i was trying to build such an external_acl thing and something is wrong
i dont quit understand.
the script was:

#!/bin/bash
i=0
while read line; do

    if [ $i == 1 ]
          then
          echo 'OK'
     i=0
    else
          echo 'ERR'
     i=1
    fi
done

and on squid.conf tried:

external_acl_type rrselector %URI /somedir/script.sh ttl=0
negative_ttl=0 grace=0 children-startup=1 children-max=1

acl rrs external rrselector

tcp_outgoing_address 10.0.0.1 rrs
tcp_outgoing_address 10.0.0.2 !rrs

but i seems to get this output every time i do a request.

2012/04/03 04:48:33.356 kid1| external_acl.cc(778) aclMatchExternal:
acl="rrs1"
2012/04/03 04:48:33.356 kid1| external_acl.cc(807) aclMatchExternal: No
helper entry available
2012/04/03 04:48:33.356 kid1| aclMatchExternal: rrs1("192.168.10.100") =
lookup needed
2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
entry=@0, age=0
2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
queueing a call.
2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100": return -1.
2012/04/03 04:48:33.356 kid1| external_acl.cc(778) aclMatchExternal:
acl="rrs1"
2012/04/03 04:48:33.356 kid1| external_acl.cc(807) aclMatchExternal: No
helper entry available
2012/04/03 04:48:33.356 kid1| aclMatchExternal: rrs1("192.168.10.100") =
lookup needed
2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
entry=@0, age=0
2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
queueing a call.
2012/04/03 04:48:33.357 kid1| aclMatchExternal: "192.168.10.100": return -1.

i am trying to understand what i did wrong.
i have used only one children to avoid any problem of two different RR
counts.

Thanks,
Eliezer

>>
>> Thats probably something we should fix. For now though an external ACL
>> could deliver round robin answers, one per request - and it could look
>> a tthe log file to learn about size of objects/ estimate bandwidth
>> etc.

>
> Okay. First of all, I see that I need to learn more about the ACL capabilities to
> understand the current options. :-) So, I see there are gobs of ACL types, and
> the external ACL allows an external program to qualify membership in an ACL?
> Looking at the documentation for external_acl_type it's a little unclear what the
> protocol to the external ACL helper is, but. I assume it's not something as simple
> as "ask this external program what the tcp_outgoing_address should be", which
> would work great for what I'm looking to do. But, if I set up N ACL's to an external,
> could I set some sort of argument to the helper? Or would I have to set up N ACL's
> and N external_acl_type names so that I could identify which ACL was being
> queried?
>
> Thanks. I'll dig more into the external ACL type. That might work, since it allow
> setting a TTL which would avoid the issue that I was concerned about using some
> sort of OS-based routing trickery, because I'd like all requests from the same client
> to the same [destination] host to use the same address, at least for the few seconds
> of a full page-load.
>
> - Chris
>

-- 
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il
Received on Tue Apr 03 2012 - 02:23:11 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 03 2012 - 12:00:04 MDT