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

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 02 Jun 2011 19:45:29 +1200

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.

>
> 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).

>
> 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

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 - 07:45:35 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 02 2011 - 12:00:02 MDT