RE: [squid-users] Two squid servers to talk to each other before the internet

From: Bucci, David G <david.g.bucci_at_lmco.com>
Date: Mon, 30 Aug 2010 04:50:41 -0400

> Two questions: I dont have to set up a parent first?
> The other squid node should be a sibling, not a parent.

In what you described, not really any need for a parent ... you use parent caches to organize your cache hierarchy, and with what you described you only have two "leaf" caches (caches that browsers directly connect to), so there's really nothing to organize. You can find out a lot more at http://old.squid-cache.org/Doc/Hierarchy-Tutorial/tutorial-7.html, of follow the "Contents" link there to study the whole topic of designing a cache hierarchy. http://etutorials.org/Server+Administration/Squid.+The+definitive+guide/Chapter+10.+Talking+to+Other+Squids/ is another resource, less terse.

One comment, I think you should have have matching ACL rules for both of the caches, or you could get into situations where users are sporadically allowed/denied access, depending on which cache is coming into play and if the link between them is down.

> What about the Prefer_direct function?
> It says works for the parents first.
> What if I have siblings, and no parents?

By default, Squid first checks if it has an URL cached locally, then if not, it tries to retrieve the URL using cache_peers, if they're alive and reachable (as determined by ICP, a caching protocol - that's the 3130 port). Only then, if no cache_peers have the URL, will it access the real server ("origin server"). "prefer_direct" tells a cache to FIRST try the origin server, and only fallback to using cache_peers if the actual server is down.

So in your situation, with what you've described, you wouldn't need to worry about prefer_direct (it defaults to "off"). Unless you meant that each cache should use the other ONLY when websites are down.

cache_peer_access, never_direct, always_direct etc. also allow you to change the default behavior - but again, in your simple situation, not necessary.

> Is there a way to check if squids are talking to each other?

Your access logs for each squid instance will show that the sibling cache was accessed. If you use any of the log analysis tools mentioned on the www.squid-cache.org site, it'll give you more insight into how your mini-hierarchy is working.

-----Original Message-----
From: Tóth Tibor Péter [mailto:tibor.peter.toth_at_mtv.hu]
Sent: Monday, August 30, 2010 2:43 AM
To: Bucci, David G; squid-users_at_squid-cache.org
Subject: EXTERNAL: RE: Two squid servers to talk to each other before the internet

The documentation on the wiki says:

"In case you want to be able to use direct connections when all the parents go down you should use a different approach:
cache_peer parentcache.foo.com parent 3128 0 no-query
prefer_direct off

The default behavior of Squid in the absence of positive ICP, HTCP, etc replies is to connect to the origin server instead of using parents. The prefer_direct off directive tells Squid to try parents first."


You've mentioned I should use
cache_peer other-server-name sibling 3128 3130

Two questions: I dont have to set up a parent first?
The other squid node should be a sibling, not a parent.

What about the Prefer_direct function?
It says works for the parents first.
What if I have siblings, and no parents?

Is there a way to check if squids are talking to each other?

Thanks,
Tibby

-----Original Message-----
From: Bucci, David G [mailto:david.g.bucci_at_lmco.com]
Sent: Friday, August 27, 2010 6:00 PM
To: Tóth Tibor Péter; squid-users_at_squid-cache.org
Subject: RE: Two squid servers to talk to each other before the internet

Absolutely ... you can examine the Wiki Features/CacheHierarchy information for the basics, http://wiki.squid-cache.org/Features/CacheHierarchy

For a very basic setup, you'll want in each squid instance's squid.conf:

     cache_peer other-server-name sibling 3128 3130

For more details, check out your Squid version's documentation on cache_peer, cacahe_peer_access, etc. -- http://wiki.squid-cache.org/SquidFaq/ConfiguringSquid#Do_you_have_a_squid.conf_example.3F has links to configuration guides for your version.


-----Original Message-----
From: Tóth Tibor Péter [mailto:tibor.peter.toth_at_mtv.hu]
Sent: Friday, August 27, 2010 9:33 AM
To: squid-users_at_squid-cache.org
Subject: EXTERNAL: [squid-users] Two squid servers to talk to each other before the internet

I was wondering, if is there any way to get two squid servers to talk to each other before going out and cacheing data from the internet?

Here is what I would need to do:

             ┌────────┐
             │ INTERNET │
             └────────┘
                     │
    ┌───────────────────┐
    │ │
    │ │
┌────┐ ┌────┐
│SQUID01│<---- I NEED THIS ---->│SQUID02│
└────┘ └────┘
    │ │
    │ │
┌────┐ ┌────┐
│CLIENT1│ │CLIENT2│
└────┘ └────┘

I want SQUID01 and SQUID02 to "ask" each other if the other have the data, before going out to the web. I guess you call this exchanging data between squids? In case if one server go down, the other need to go directly to the internet, and not just standing and waiting for answer from a disabled machine.

Can this be done int he squid.conf file?

Thanks,
Tibby
Received on Mon Aug 30 2010 - 08:50:54 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 30 2010 - 12:00:03 MDT