Re: [squid-users] question in cache mem in squid 3

From: Carlos Defoe <carlosdefoe_at_gmail.com>
Date: Wed, 31 Jul 2013 21:05:37 -0300

OK, I thought of the cache_dir while I was writing, but in general,
the cache_mem is the configuration we can change from, let's say, 8 GB
to 32 GB in a minute. What i was asking was: if i have 40 GB of RAM,
can I set something like 32 GB to cache_mem, making the box operate
with about 39GB of memory effectively used, and leaving only something
like 1 GB, or less, for that linux "cache" thing?

In a box without a proxy-cache, let's say, a DNS server, linux will
not use nothing more than 1GB of RAM, doing no "disk cache". But the
fact is that you can put 100GB on a linux box with squid, with only 2
GB of cache_mem, 20 GB of cache_dir, and we will have about 4GB of RAM
effectively used, and all the rest of the memory will be "used" as
disk cache by linux. There's no real need for that? Can we grow the
effective usage, configuring squid, until we have no memory used for
"cache" by linux?

On Wed, Jul 31, 2013 at 11:29 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On 1/08/2013 2:07 a.m., Carlos Defoe wrote:
>>
>> i have one question.
>>
>> Can i adjust my system memory usage (by changing cache_mem, the only
>> ammount changeable) to an ammount where no space is left for that
>> "cache"? If a linux machine with squid uses the more RAM you provide,
>> for that "cache" thing, it must be useful. It is better to leave some
>> space for that, or not?
>
>
> You can change system memory usage by Squid by changing any of the
> parameters which directly or indirectly consume that memory.
>
> The most noticable is cache_mem, which consumes about 1.015 GB for every 1GB
> it is set to.
> The less noticable are cache_dir which consume about 15MB of memory per GB
> of cache size.
> The helper result caches.
> The two DNS result caches (one for each type of forward/reverse lookup).
> The database of active clients.
> Active transaction buffers (read_ahead_gap amount of memory is concumed once
> per FD).
> Idle connection pool and all the buffers associated with those connections.
> Which components are used by a transaction also affect memory usage (one
> ICAP request consumes twice as many FD and memory buffers as a non-ICAP
> equivalent).
> Even tuning timeouts affects total memory needs, as some transactions end
> and release their memory more quickly.
>
> Lots of ways to tune Squid memory usage. Some more effective than others and
> most trading traffic speed for memory.
>
> Amos
Received on Thu Aug 01 2013 - 00:05:44 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 01 2013 - 12:00:32 MDT