Re: [squid-users] DIRTY cache problem

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 21 May 2009 13:05:15 +1200 (NZST)

> Hello All,
>
> Anybody know why I am getting "Rebuilding storage in
> /usr/local/squid/var/cache (DIRTY)" in my cache.log when I restart squid?
> I
> read in an old message from Heinrich that it was because squid wasn't
> shutdown properly. However, I have completely rebuilt squid
> and still get the same messages.
>
> The problem is that when I redirect port 80 clients through squid now,
> they just hang. There are no indications in any logs that the
> clients are even making it to squid. However, if I disable the proxy
> setting in a client, the connections are made immediately.
> Squid has been working perfectly for months and now this DIRTY cache
> message and clients hang.

This is known behavior when Squid is overloaded with some task. A lot of
work has been done since 2.5 to reduce this, but there are still some
instances where it happens.

What I believe is happening here is that Squid is busy processing the
cache, and client requests are left queued up in the OS connection buffer.
They will get handled, but is a slow race between the client connect
timeout and whatever squid is doing.

>
> I did have a power failure that lasted longer than my UPS could support,
> so the server died abruptly. This would account for the
> improper shutdown that Heinrich mentioned, but now I have completely
> rebuild the entire squid directory structure and squid.
>
> I am using squid-2.5.STABLE4!

Please upgrade then :)

>
> Anybody know what is going on here and how I can correct it?
>

'DIRTY' just means the swap.state was missing or unreadable (as happens
after a bad shutdown or crash) and squid has to rebuild from a complete
file scan of the cache_dir.

If the swap.state exists, try stopping squid, deleting it, and then
starting Squid. You will get one run of DIRTY, let it finish, then further
restarts should work okay again.

Amos
Received on Thu May 21 2009 - 01:05:24 MDT

This archive was generated by hypermail 2.2.0 : Thu May 21 2009 - 12:00:01 MDT