Re: How to set up one peer correctly

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 22 Mar 1999 23:07:30 +0100

Chris Tilbury wrote:

> > Couldn't find this one in the FAQ: how do I set up my squid (2.1.patch2)
> > so that it will always go to another proxy when it is available, but go
> > direct when it can't reach the other proxy for some reason?
>
> You can't, yet. 2.2 has a prefer_direct which would seem to fit the bill,
> but that release isn't ready yet.

A note on this issue:

In short:
There are reasons to why Squid bypasses parents on non-hierarchical
requests. In most cases it makes very little sense to absolutely enforce
the use of parents on these requests as it only adds more overhead and
latency. The criterias for being non-hierarchical is mainly that the
request can't be served from cache or that the reply can't be cached
(which implies the former).

Long version:
Correctly configured Squid 2.1 uses parents unless the request are
classified as non-hierarchical. Non-hierarchical requests are such
requests where it would not benefit in either hit ratio or latency from
using a parent. Examples of non-hierarchical requests are Pragma:
no-cache (Reload button) or PUT/POST requests.

About the only reason to force a non-firewalled Squid to always use a
parent is where network payment rates makes it cheaper to use the parent
than go direct or where the parent has a much better connection to the
origin server (different network paths). In most of the cases where this
is true doing this can be regarded as a mild form of network policy
abuse. Doing this in other configurations only makes performance and
total (local+parent) hit ratio worse.

"Simplest" cache_peer configuration for a single non-ICP parent is
currently:

cache_peer proxy.parent.net 8080 0 no-query default no-digest
no-netdb-exchange

Explained:
Parent proxy proxy.parent.net on port 8080
Don't send ICP queries to this peer (ICP port 0, no-query option)
Don't request Cache-Digests from this peer (no-digests)
Don't request netdb exchanges from this peer (no-netdb-exchange)
Use this peer as a default parent (default)

A alternative configuration is to specify port 7 as ICP query port and
not use the no-query, but unless the connection to the parent is very
unreliable you will only get a higher latency from doing so. This is
even more true when 2.2 is released.

Even if ICP/echo isn't used to probe the parents status, Squid will
detect if the parent is dead and stop using it.

---
Henrik Nordstrom
Spare time Squid hacker
Received on Mon Mar 22 1999 - 15:16:28 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:45:22 MST