[squid-users] Slowness in Squid

Antony Stone Antony.Stone at squid.open.source.it
Sun Oct 23 08:16:28 UTC 2016


On Sunday 23 October 2016 at 05:36:22, Krishna Kulkarni wrote:

> I am new to squid.. I have installed squid 3.5 on CentOS 6.7. As a
> configuration part, I have kept most of the things default. Please advice
> on how to allocate cache memory of 20 GB to squid.

Do you mean cache memory, or disk cache?


If you mean memory (RAM) and you have enough of this in your system (eg: 32 
Gbytes or more), then find the section in squid.conf which starts with:

# MEMORY CACHE OPTIONS

And read about the tag "cache_mem".

To set this value (normally 256 Mbytes) to 20 Gbytes, set:

cache_mem 20 GB


If, on the other hand, you do not mean memory, but you mean disk cache, then 
find the section in squid.conf with starts with:

#  TAG: cache_dir

and read that section.

Pay particular attention to the line which says:

#       cache_dir ufs Directory-Name Mbytes L1 L2 [options]

And then later there is an example:

# cache_dir ufs /var/spool/squid3 100 16 256

Uncomment that line and change the 100 (Megabytes) in that line to 20000 (for 
20 Gigabytes) and perhaps also adjust the 16 to something like 64 or even 256 
- for a large cache you don't want a few directories with lots of entries 
each, so it's worthwhile creating lots of directories to keep the number of 
files in each down.

> I got to know that, more cache memory would increase performance of squid..

What do you mean by "performance"?


Antony.

-- 
Just when you think you're done, a cat floats by with buttered toast strapped 
to its back.

 - Steve Krug, "Don't make me think"

                                                   Please reply to the list;
                                                         please *don't* CC me.


More information about the squid-users mailing list