Re: [squid-users] Squid not caching. Please help.

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 12 May 2013 19:13:02 +1200

Some comments inline about what you are seeing.

We will need to know what the output of your "squid -v" is and the
contents of your squid.conf file please (excuding any # commented lines).

On 12/05/2013 5:00 p.m., PARAM KRISH wrote:
> Hello
>
> I have the squid running at port80 with the cache_peer on 443
>
> I see there is only TCP_MISS/200 or TCP_MISS_ABORTED/200, I doubt
> whether Squid is really caching of the pages.

If those are the only lines, then probably not.

> Analysing the squid-internal-mgr shows ..something like this .. that
> gives me a feeling that it caches only png files?
>
>
> KEY A4C05546F054C963F60E83AB7F691CE7
> STORE_OK IN_MEMORY SWAPOUT_NONE PING_NONE
> SPECIAL,CACHABLE,VALIDATED
> LV:1368333867 LU:1368333867 LM:1365163353 EX:-1
> 0 locks, 0 clients, 0 refs
> Swap Dir -1, File 0XFFFFFFFF
> GET http://wikid-dev.domain.com/squid-internal-static/icons/silk/film_key.png
> inmem_lo: 0
> inmem_hi: 1053
> swapout: 0 bytes queued

You can ignore these ones, the /squid/internal-icons/ are served
internally by Squid and not related to cacheability of your site content.

However, the ones you are listing here show that FTP or Gopher directory
listings are being done and yoru Squid is supplying the page icons for that.

> cache_store_log shows
> 1368334342.699 RELEASE -1 FFFFFFFF FCD06E1B1AB3B6BEF0BC8AD5D4F04D9C
> 200 1368334342 1368194177 1368334342 text/html -1/-505 GET
> http://wikid-dev.eng.domain.com/
> 1368334372.653 RELEASE -1 FFFFFFFF 2D355F1E8F50FB487C85077838F16C4F
> 200 1368334372 1368194177 1368334372 text/html -1/-505 GET
> http://wikid-dev.eng.domain.com/
> 1368334402.562 RELEASE -1 FFFFFFFF 4BA7AD9FCACE409B5505597981969600
> 200 1368334402 1368194177 1368334402 text/html -1/-505 GET
> http://wikid-dev.eng.domain.com/
> 1368334432.646 RELEASE -1 FFFFFFFF 81F96406F0A22CE4AE629ABFBBEA512A
> 200 1368334432 1368194177 1368334432 text/html -1/-505 GET
> http://wikid-dev.eng.domain.com/

Okay, please take a read through what these log file lines mean:
http://wiki.squid-cache.org/SquidFaq/SquidLogs#store.log

Firstly, the directory ID is -1, meaning these objects are cached in
memory instead of disk.

Secondly, the Expires and Date are identical. So the objects are already
expired and will need to be replaced on next use even if Squid did store
them.

Thirdly, the size of objects delivered was apparently -505 bytes (note
the negative). Something has gone wrong there. If the wiki is to be
believed "If the advertised length is not zero, but not equal to the
real length, the object will be released from the cache." which could
account for the removal.

> Am i missing something in my config to make it work, or all is ok ?

Showing us the config would help answer that one.
Both squid.conf and a clear description of how the F5s are forwarding
traffic to Squid and how the squid box is receiving that traffic would
be a good start.

> Can someone clarify further please ?
>
> First of all I am running F5's (Load Balancers) before squid hence i
> cant make the squid work with 443 for f5's to forward the requests

Why not? 443 and 80 are just ports. Both are just transferring TCP
packets. When routing them there is no difference.

> which is
> why i have f5 @443 forward requests to squid80, that goes to two
> apache's at 443, they work fine functionally but when i check the logs
> i get the feeling
> that the cache is not being used in squid. Any comments ?

Amos
Received on Sun May 12 2013 - 07:13:07 MDT

This archive was generated by hypermail 2.2.0 : Sun May 12 2013 - 12:00:05 MDT