Re: [squid-users] Siblings querying over HTCP with the originating squid IP in URL

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 16 Jul 2011 15:28:25 +1200

On 16/07/11 05:24, Dan Ford wrote:
> Hello,
>
> I am trying to setup a sibling cache using htcp between the sibling
> cache_peers so that squid will differentiate cache hits from different
> user agents. When I hit the squid via localhost it queries it's sibling
> cache and is able to serve back the cache hit from the sibling however
> when I hit it using a non localhost address it appears to use it's IP in
> the request to it's sibling. . .

Nope. Its using the absolute URL you passed it.
ie curl ... "http://10.0.21.25:8080/..."

>
> here's my setup:
> sibling caches - transcode-cache-04 (10.0.21.15) and transcode-cache-05
> (10.0.21.25)
> parent cache - transcode-cache-prod
>
> If I do the following hit:
> curl -D - -s -o /dev/null -A "audio/VAN_MP3 FBR 64kbps 125kB.xml"
> "http://127.0.0.1:8080/TranscodingInterface/preview/RAAz1rqL"
> on transcode-cache-05 with that piece of content in the cache on
> transcode-cache-04 it works as it queries the cache for the request:
> http://127.0.0.1:8080/TranscodingInterface/preview/RAAz1rqL which is the
> same on both 04 and 05.
>
> If I do the following hit:
> curl -D - -s -o /dev/null -A "audio/VAN_MP3 FBR 64kbps 125kB.xml"
> "http://10.0.21.25:8080/TranscodingInterface/preview/RAAz1rqL"
> it makes the request from it's sibling cache (10.0.21.15) as:
> http://10.0.21.25:8080/TranscodingInterface/preview/RAAz1rqL which will
> never be in the cache for 10.0.21.15 even though the actual content is
> in the cache.
>
> My question is how do I get squid using HTCP to query the sibling cache
> with the sibling's IP as opposed to the originating cache's IP? Is this
> possible? If not how do others use HTCP?

Localhost is an edge case and will also fail as soon as you need scale
out to even one squid without own internal transcoder.

Don't use absolute IP addresses in the URL to start with. Use a shared
public domain name for the whole set of caches. Squid cache_peer entries
pointing at their nearest transcoder as a origin source (parent?).

squid.conf (sibling 1):
   visible_hostname transcode.example.com
   visible_hostname transcode-cache-04.example.com
   cache_peer 10.0.21.15 sibling 8080 0
   cache_peer transcode-cache-prod parent ?? ?? origin

squid.conf (sibling 2):
   visible_hostname transcode.example.com
   unique_hostname transcode-cache-05.example.com
   cache_peer 10.0.21.25 sibling 8080 0
   cache_peer transcode-cache-prod parent ?? ?? origin

DNS:
  transcode-cache-04.example.com. A 10.0.21.15
  transcode.example.com. A 10.0.21.15

  transcode-cache-05.example.com. A 10.0.21.25
  transcode.example.com. A 10.0.21.25

Then your test:

curl -D - -s -o /dev/null -A "audio/VAN_MP3 FBR 64kbps 125kB.xml"
   "http://transcode.example.com:8080/TranscodingInterface/preview/RAAz1rqL"

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.14
   Beta testers wanted for 3.2.0.9
Received on Sat Jul 16 2011 - 03:28:34 MDT

This archive was generated by hypermail 2.2.0 : Sun Jul 17 2011 - 12:00:02 MDT