Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: Michail Pappas on April 25, 2012, 11:06:44 AM

Title: Increase squid cache size and/or cache_mem
Post by: Michail Pappas on April 25, 2012, 11:06:44 AM
Hello all,

I've read the db commands reference, checked config show squid and searched the forum and wiki, but I was unable to find what I'm looking for: is it possible to simply change the cache size and the RAM allocated (cache_mem) using only by config set commands, or is the only way possible through creating a template?
Title: Re: Increase squid cache size and/or cache_mem
Post by: mmccarn on April 25, 2012, 01:49:20 PM
Here's are some notes on general template / service configuration settings:
http://wiki.contribs.org/Template_Tutorial#Detailed_generic_troubleshooting_.26_configuration_steps

The squid configuration file is built based on the templates in /etc/e-smith/templates/etc/squid/squid.conf.

Looking at the template fragments in that folder, I don't see anything about "cache_mem", "cache_dir" or "size" -- so you would have to create custom template fragments if you want to set non-default values for any of these.
Title: Re: Increase squid cache size and/or cache_mem
Post by: Michail Pappas on May 08, 2012, 08:21:58 AM
Sorry for the late reply, been ultra busy...

I think I managed to make my first SME template :)

Just for the record, these are the changes I implemented to allow the user to have a custom cache:

File /etc/e-smith/templates-custom/etc/squid/squid.conf/cache_dir_size/75cache_dir_size (if directory /etc/e-smith/templates-custom/etc/squid/squid.conf/cache_dir_size/ does not exist, create it first):
Code: [Select]
{
    $OUT .= "cache_dir aufs /var/spool/squid/ " . ($squid{cache_dir_size} || '100') . " 16 256\n";
}

Then run the following commands ONCE:
Code: [Select]
config setprop squid cache_dir_size 1000
expand-template /etc/squid/squid.conf
sv stop squid
sv start squid