Re: [squid-users] squid rock caching memory RAM

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 06 Jul 2014 20:04:13 +1200

On 2014-07-06 19:39, israelsilva1 wrote:
> Using:
> /cache_dir rock /cache1/squid 1000 max-size=3200 swap-timeout=300
> max-swap-rate=100
> /
> I get:
> /# free -m
> total used free shared buffers
> cached
> Mem: 15951 1378 14573 0 82
> 1055
> -/+ buffers/cache: 240 15711
> Swap: 4031 0 4031
> /
>
> Using:
> /cache_dir rock /cache1/squid 5000 max-size=3200 swap-timeout=300
> max-swap-rate=100/
>
> I get:
> /# free -mt
> total used free shared buffers
> cached
> Mem: 15951 5409 10541 0 82
> 5079
> -/+ buffers/cache: 247 15703
> Swap: 4031 0 4031
> Total: 19983 5409 14573/
>
>
> When squid is stopped:
> /# free -mt
> total used free shared buffers
> cached
> Mem: 15951 334 15616 0 82
> 39
> -/+ buffers/cache: 212 15738
> Swap: 4031 0 4031
> Total: 19983 334 19648
> /
>
> If I use aufs it won't cache the memory ram even when using hundreds of
> GB
> for cache_dir.
>

Twp potential diiferences:

1) AUFS memory index is just RAM allocated with new/delete to the Squid
process. Rock store loads the cache as a memory mapped file. How the
memory mapped files are handled is up to your OS.

2) AIUI, Rock allocates the cache index space in full regardless of
usage. AUFS only allocates memory for used cache entries. When both
caches are full the RAM consumption is comparible, empty caches fill up
so the differences when empty does not matter.

>
> My config:
> /memory_pools off
> # Set highwateer in memory cache limit
> cache_mem 2 GB
>
> # Maximum size of cached objects in memory
> maximum_object_size_in_memory 500 KB
>
> # Set the Cache Replacement Policy. Either retain popular small files
> (GDSF)
> or just popular files regardless of size (LFUDA)
> # Default is LRU wich is recently referenced objects.
> memory_replacement_policy heap GDSF
>
> # Enable pre-allocated memory
> memory_pools_limit 1 GB
>
> #########################################################################
> #########################################################################
> ###
> ### DISK CACHE OPTIONS
> ###
> #########################################################################
> #########################################################################
>
> # Set the Cache Replacement Policy. Either retain popular small files
> (GDSF)
> or just popular files regardless of size (LFUDA)
> # Default is LRU wich is recently referenced objects.
> cache_replacement_policy heap LFUDA
>
>
> # Max size of objects in cache
> #maximum_object_size 100000000
>
> # Swap low and high watermarks
> cache_swap_low 90
> cache_swap_high 95
> /
>
>
>
> /# squid -v
> Squid Cache: Version 3.HEAD-20140127-r13248

Please build a newer Squid. There have been some major bugs fixed in the
last few months.

Amos
Received on Sun Jul 06 2014 - 08:04:32 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 10 2014 - 12:00:06 MDT