Re: [squid-users] moving cache.swap or rotating more frequently?

From: Tory M Blue <tmblue_at_gmail.com>
Date: Thu, 2 Jun 2011 10:33:21 -0700

On Thu, Jun 2, 2011 at 12:45 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On 02/06/11 18:27, Tory M Blue wrote:
>>
>> Afternoon
>>
>> Have  a question, is there a negative to running -k rotate more than
>> once a day?
>
> All your active connections will pause while Squid deals with the logs.
>

Ahh wasn't aware thanks, but it seems to be pretty quick, so not sure
this is terrible :)

>> I've recently moved squid to a ramcache (it's glorious), however my
>> cache.swap file continues to grow and brings me to an uncomfortable
>> 95%.
>
> By "ramcache" do you mean RAM cache (aka a large cache_mem storage area) or
> an in-memory pseudo disk?
>
> Tried using COSS? (in-memory pseudo disk with hardware backing).

In memory psuedo-disk /dev/ram0.

I tried Coss before and it was a really bad experience, wonder if I
try it with the pseudo-disk instead of on hard disk (I setup coss
before using standard fast SAS disks (not memory) and it was slower
then sin, really bad, 20-30 seconds for the first image etc. Maybe
what you are saying is I did my test wrong and COSS should be used
with a in memory "pseudo-disk", like what I'm running now with aufs..
hmmm

>>
>> If I run rotate it goes from 95% to 83% (9-12gb cache dir), it seems I
>> need to run this once every 12 hours to stay in a good place, but is
>> there anything wrong with that? I don't see it and seems that the
>> rotate really just cleans up the swap file and since it's all in ram,
>> it's super fast.
>
> That should be fine even if its was on disk. High throughput networks are
> known to do it as often as every 3 hours with only minor problems.
>  I've only heard of one network doing it hourly, the pause there was
> undesirable for the traffic being handled.
>  There is a nasty little feedback loop: the faster to *have* to do it the
> worse is the effects when you do. It is economical, up to a point.
>
>
>>
>> Another option is to move the swap file to a physical disk, what type
>> of performance hit will my squid system take? Obviously it's just
>> looking up, reading hash so it should not cause any issues, but
>> wondered. What is my best option, keep everything in ram and run
>> rotate 2-3x a day or is the penalty so small that pushing the swap
>> file to a physical disk a better answer?
>
> Unsure. Try it and let us know.
>
> The swap.state is a journal with small async writes for each file operation
> (add/remove/update of the cache_dir), including those for temporary files
> moving through. You only get into problems if the write speed to it falls
> behind the I/O of the cache its recording. (in general, on average etc..
> Peak bursts should not be a big problem)
>  Squid can recover from most swap.state problems. But it is best to avoid
> that kind of thing becoming normal.
>
> HTH

Always thank you sir.

Tory
> Amos
> --
> Please be using
>  Current Stable Squid 2.7.STABLE9 or 3.1.12
>  Beta testers wanted for 3.2.0.8 and 3.1.12.2
>
Received on Thu Jun 02 2011 - 17:33:28 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 03 2011 - 12:00:01 MDT