Re: [squid-users] Connect directly if parent cache fails

From: 叶雨飞 <sunyucong_at_gmail.com>
Date: Sun, 20 Feb 2011 23:27:50 -0800

Hi there,

I've been trying to do the same thing, but squid always tries too hard
on parents.

You can do this as what I do:

Have a local squid with "always_direct allow all" listening on another
port as the last entry of cache_peer with a default .

when squid tried the peers above and failed, it will fall back to the
last one which runs on the same computer, so should (suppose) always
work as long as your local network works..

On Sun, Feb 20, 2011 at 10:18 PM, Tom Tux <tomtux80_at_gmail.com> wrote:
> Hi
>
> Is my scenario in general possible to implement (connect directly, if
> the one and only cache_peer fails)?
>
> Thanks a lot.
> Tom
>
> 2011/2/17 Tom Tux <tomtux80_at_gmail.com>:
>> Hi Amos
>>
>> This doesn't work as expected. I removed the "never_direct" entry (I
>> was unsure, how "strong" it is in the configuration...) and dropped
>> also the hierarchy_stoplist-directive.
>>
>> But if the cache_peer fails, it either connects directly (if I have
>> set nonhierarchical_direct on) or the connect will fail.
>>
>> I just want to implement the behavior, that when the cache_peer fails,
>> the squid should connect directly.
>>
>> Thanks a lot for your help.
>> Tom
>>
>>
>> 2011/2/17 Amos Jeffries <squid3_at_treenet.co.nz>:
>>> On 17/02/11 21:29, Tom Tux wrote:
>>>>
>>>> Hi
>>>>
>>>> I'm trying to configure Squid (3.1.9) to connect directly, if the one
>>>> and only cache_peer (parent) fails:
>>>>
>>>> cache_peer xx.xx.xx.xx parent �8080 � � � � � �0 � � � no-query
>>>> no-digest default connect-fail-limit=5
>>>> prefer_direct off
>>>> never_direct allow all
>>>>
>>>>
>>>> But squid will never connect directly, even if the parent isn't
>>>> available. How can I implement this?
>>>>
>>>
>>> WTF? (sorry but you will kick yourself in a second)
>>>
>>> You have set a directive called "never_direct" to always be true/on/working
>>> and are having trouble because Squid never connects directly.
>>>
>>>
>>> So, you need to drop that never_direct entry.
>>> Also drop any hierarchy_stoplist entries.
>>>
>>> Also take a look at nonhierarchical_direct, it operates on requests like
>>> CONNECT which are best handled directly. Setting it to ON will make the peer
>>> handle those as well when its available.
>>>
>>> Amos
>>> --
>>> Please be using
>>> �Current Stable Squid 2.7.STABLE9 or 3.1.11
>>> �Beta testers wanted for 3.2.0.5
>>>
>>
>
Received on Mon Feb 21 2011 - 07:28:17 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 21 2011 - 12:00:02 MST