Re: [squid-users] Problem with Restarted Squid Stable 2.6_19 Add

From: Amos Jeffries <>
Date: Tue, 22 Apr 2008 20:29:52 +1200

Nicole wrote:
> On 21-Apr-08 My Secret NSA Wiretap Overheard Adrian Chadd Saying :
>> On Sun, Apr 20, 2008, Nicole wrote:
>>>> I took a look at this over the weekend (whilst looking at other stuff in
>>>> the
>>>> storage code) and I could -probably- make the AUFS swaplog parsing case
>>>> much
>>>> faster. I've just got other priorities at the moment (ie, lots more
>>>> cleaning
>>>> up
>>>> before I start breaking things in creative ways.)
>>> Is this perhaps a recent change? I never noticed this until I upgraded.
>>> (from
>>> -16 I think) I tried downgrading once after a reboot, however I got the same
>>> results when i tried to restart it. But other servers I have, with older
>>> revs,
>>> don't have this problem.
>> Its been like this forever. How big are your swaplog files in each of your
>> cache dirs? Do you perodically rotate the logfiles? (squid -k rotate)
> Hi
> The swaplog files are about 156 megs. Altho I have some servers that have
> swaplogs that are 1.6 gigs but are fine as they the servers have never been
> restarted.

The size of the swaplog / swap.state files won't matter (on 64-bits
machines anyway) until a restart or rotate is needed. Then it may crunch
on re-processing.

> I have never run squid -k rotate. I have another server that just started
> exibiting the same sort of behaviour of slowing down. I tried lowing the
> available disk size to force it trim some files and did a squid -k rotate but
> it was still slow.

Ah, that is part of the problem then.
swap.state 'log' are not true logs, but a journal of cache operations.
-k rotate performs a cleanup of the cache and shrinks the journals down
to whats actually still present in cache. Alongside rotating the real
log files.

You need to complete at least one full rotate/restart for the ancient
data to be removed from cache+journals before any speed problems can be
meaningfully judged.

If it is still going slow on a second restart/rotate thats an issue to
look into.

Going by the problems you are encountering each time it happens, I'd do
the machines one by one and ensure each finishes and is okay before
moving to the next server.

> It's getting to be kind of a drag having to contantly wipe out the cache every
> few months when they get to a larger size. The disks are 146 Gig and are only
> 56% full. I am trying to keep lowering the alloted available cache size to see
> if there is a sweet spot.
> How often should squid -k rotate be used. It seems like there are various
> opinions on its usage and frequency.

Theoretically daily is best.
But in real-usage it depends on the server load and traffic. Gaps as
long as monthly might be okay.


Please use Squid 2.6.STABLE19 or 3.0.STABLE4
Received on Tue Apr 22 2008 - 12:31:05 MDT

This archive was generated by hypermail 2.2.0 : Thu May 01 2008 - 12:00:04 MDT