[squid-users] Time for cache synchronization between siblings
Amos Jeffries
squid3 at treenet.co.nz
Tue Dec 15 22:22:04 UTC 2015
On 16/12/2015 7:16 a.m., Sreenath BH wrote:
> Hi,
>
> I have a setup with three squid peers (siblings in squid.conf) and
> three upstream servers(peers with parent and originserver in
> squid.conf).
>
> I am using htcp for the three squid siblings.
> How much time does it take for one squid server to 'know' that another
> peer has a particular object cached? I see digests exchanged between
> the siblings, as logged in cache.log.
When both HTCP an dDgests are active between siblings the maximum time
is however long it takes for the HTCP packet to reach the sibling, be
parsed, looked up in the cache and response to get back.
Digests are used to short-circuit the ICP or HTCP process. If the digest
contains an entry for the URL the peer will be selected as a possible
destination server. Regardless of whether the object stored for that URL
is the same one the client is fetching.
Digests are updated every digest_rebuild_period (default 1 hr). You can
disable digests with either "digest_generation off" or per-peer with the
cache_peer no-digest option.
>
> I have been able to make a request to one sibling and it resulted in a
> sibling_hit.
>
> How I do this test is this:
> 1. bring up all siblings
> 2. issue a request to one server (sibling 1)
> 3. Make sure it is cached in sibling 1
> 4. Wait for some time (I don't know how long to wait)
Until the log of sibling1 contains a digest fetch from sibling2. A
restart of sibling2 will make that happen faster.
> 5. Make same request to another sibling, say sibling 2
> 6. Check if it went to upstream server for the request or it was a sibling hit.
>
> My problem is that the sibling hits seem to be random. I am not able
> to figure out exactly
> how log it takes for the cache information to propagate to all siblings.
Digest is a old algorithm designed as an optimization of ICP, and
likewise is based on URL alone - which is great for HTTP/1.0 traffic. In
modern HTTP/1.1 traffic the Vary headers have a big part to play and
HTCP with full-header lookups works much better.
I suggest trying with only HTCP (digests disabled) and see if your
performance improves at all. YMMV though.
Be aware that there is no guarantee that any object is still in cache,
even with the more reliable HTCP on-demand lookups. Any object could be
dropped from sibling1 cache picoseconds after the "i have it" reply
started being formed for delivery to sibling2 (before it even hits the
wire on its way back).
Amos
More information about the squid-users
mailing list