Memory Usage

This page provides access to most of the options available for configuring the way Squid uses memory and disks (Figure 12-4). Most values on this page can remain unchanged, except in very high load or low resource environments, where tuning can make a measurable difference in how well Squid performs.

click to expand
Figure 12-4: Memory and disk usage

Memory usage limit

The limit on how much memory Squid will use for some parts of its core data. Note that this does not restrict or limit Squid's total process size. What it does do is set aside a portion of RAM for use in storing in-transit and hot objects, as well as negative cached objects. Generally, the default value of 8MB is suitable for most situations, though it is safe to lower it to 4 or 2MB in extremely low load situations. It can also be raised significantly on high-memory systems to increase performance by a small margin. Keep in mind that large cache directories increase the memory usage of Squid by a large amount, and even a machine with a lot of memory can run out of memory and go into swap if cache memory and disk size are not appropriately balanced. This option edits the cache_mem directive. See the section on cache directories for more complete discussion of balancing memory and storage.

Caution 

If Squid is using what you consider to be too much memory, do not look here for a solution. It defaults to a modest 8MB, and only when you have configured a very small amount of cache storage will this 8MB be a significant portion of the memory Squid allocates. If you do find yourself running out of memory, you can lower the size of your configured cache directories for a more noticeable decrease in memory used.

FQDN cache size

Size of the in-memory cache of fully qualified domain names. This configures the fqdncache_size parameter and defaults to 1024, which is usually a safe value. In environments where DNS queries are slow, raising this may help.

Memory high water mark, Memory low water mark

Sets the points at which Squid begins to remove objects from memory. As memory usage climbs past the low water mark, Squid more aggressively tries to free memory. Note this applies to the memory usage limit defined above, not the total process size of Squid. If you have a system that is doing double or triple duty and providing more than cache services, it may be wise to set the low water mark at a low number, like 50%, and the high mark at a high number like 95%. In such a case, Squid will mostly keep its usage at 50%, but if it begins to get overloaded, or a particularly large object comes through the cache, it can briefly go over that point. This option configures the cache_mem_low and cache_mem_high options, which default to 90% and 95%, respectively.

Disk high-water mark, Disk low-water mark

Provide a mechanism for disk usage similar to the memory water marks above. To maximize hit ratio and provide most efficient use of disk space, leave this at the default values of 90% and 95%. Or to maximize performance and minimize fragmentation on disk, set them to a higher spread, such as 85% and 100%. Note that these settings are not where the amount of disk space to use is configured, they only define the percent of the allotted cache space at which Squid should begin to prune out old data to make room for incoming new objects. These options correlate to the cache_swap_high and cache_swap_low directives.

Maximum cached object size

The size of the largest object that Squid will attempt to cache. Objects larger than this will never be written to disk for later use. Refers to the maximum_object_size directive.

IP address cache size, IP cache high-water mark, IP address low-water mark

The size of the cache used for IP addresses and the high and low water marks for the cache, respectively. This option configures the ipcache_size, ipcache_high, and ipcache_low directives, which default to 1024 entries, 95%, and 90%.



The Book of Webmin... or How I Learned to Stop Worrying and Love UNIX
The Book of Webmin: Or How I Learned to Stop Worrying and Love UNIX
ISBN: 1886411921
EAN: 2147483647
Year: 2006
Pages: 142
Authors: Joe Cooper

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net