[squid-users] TCP_HIT/504 on fetch after UDP_HIT

From: Taylan Develioglu <tdevelioglu_at_ebuddy.com>
Date: Wed, 24 Mar 2010 13:40:34 +0100

Hi,

I'm trying to set up two squid siblings in front of lighttpd as reverse
proxies and have a question about some behavior I'm seeing.

Squid versions are 2.7.STABLE7-1~bpo50+1 from the debian backports
repository.

My goal is to create a setup with two cache siblings and one origin
server (lighttpd) where no duplicate cached entries between siblings
exist.

I am getting these TCP_HIT/504's and I can't understand why they are
happening.

When I do a refresh in firefox and request a picture from sibling1,
requested before on sibling2, I see the following:

sibling1 is 5.5.5.5

- The original request on sibling 1:

1269431848.626 4 1.1.1.1 TCP_MISS/304 378 GET
http://pictures.something.com/pics/d/3/c/picture.jpg -
DEFAULT_PARENT/pict-dev image/jpeg

- A UDP_HIT occurs on sibling2, sibling1 tries to fetch the file but it
received a 504 instead (excerpt below).

269431848.881 0 5.5.5.5 UDP_HIT/000 76 ICP_QUERY
http://pictures.something.com/pics/d/3/c/picture.jpg - NONE/- -
1269431848.883 1 5.5.5.5 TCP_HIT/504 1752 GET
http://pictures.something.com/pics/d/3/c/picture.jpg - NONE/- text/html

----start----

HTTP/1.0 504 Gateway Time-out
Expires: Wed, 24 Mar 2010 09:55:19 GMT
X-Squid-Error: ERR_ONLY_IF_CACHED_MISS 0
Age: 1269424520
Warning: 113 localhost (squid/3.0.STABLE8) This cache hit is still fresh
and more than 1 day old
X-Cache: HIT from localhost
X-Cache-Lookup: HIT from localhost:80

The requested URL could not be retrieved
Valid document was not found in the cache and 'only-if-cached'
directive was specified.

You have issued a request with a 'only-if-cached' cache control
directive. The document was not found in the cache, or it required
revalidation prohibited by 'only-if-cached' directive.

----end----

Why does sibling2 respond with a UDP_HIT but then sends a 504 error page
to sibling1 when sibling1 tries to fetch the picture?

Is this normal behavior or am I doing something wrong here? Please see
my squid.conf below, suggestions are very much appreciated and thanks in
advance.

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 #http
acl Safe_ports port 21 #ftp
acl Safe_ports port 443 #https
acl Safe_ports port 70 #gopher
acl Safe_ports port 210 #wais
acl Safe_ports port 1025-65535 #unregistered ports
acl Safe_ports port 280 #http-mgmt
acl Safe_ports port 488 #gss-http
acl Safe_ports port 591 #filemaker
acl Safe_ports port 777 #multiling http
acl CONNECT method CONNECT

acl sites dstdomain pictures.something.com
acl siblings src 6.6.6.6

cache_peer 4.4.4.4 parent 80 0 default no-query no-digest originserver
name=lighttpd-server login=PASS
cache_peer 6.6.6.6 sibling 80 9832 proxy-only
name=sibling2

cache_peer_access lighttpd-server allow sites
cache_peer_access sibling2 allow sites

http_access allow sites
http_access allow siblings
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all

icp_access allow siblings
icp_access deny all

htcp_access deny all

miss_access deny siblings

http_port 80 act-as-origin accel vhost
icp_port 9832

access_log /var/log/squid/access.log
debug_options ALL,3
cache_mgr cachmgr_at_domain.com

cache_dir aufs /var/spool/squid 4000 32 128

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
Received on Wed Mar 24 2010 - 12:40:51 MDT

This archive was generated by hypermail 2.2.0 : Wed Mar 24 2010 - 12:00:06 MDT