Re: [squid-users] Linux EXT3 optimizations for Squid

From: Marcus Kool <marcus.kool_at_urlfilterdb.com>
Date: Sun, 08 Aug 2010 10:42:49 -0300

Nyamul Hassan wrote:
> Hi,
>
> I would build with the following in mind:
>
> 1. Better to have a separate disk for the cache stores.
> 2. Have a COSS store for objects less than 256k. And let AUFS handle
> larger objects.
> 3. Don't have more than 75% of your disk allocated.
> 4. Only one AUFS store per disk. But you can have more than one COSS.

Use AUFS on Linux and DISKD on BSD.

> 5. RAID is highly discouraged.

RAID is not highly discouraged. All depends on functional and technical
requirements. For example, RAID is a highly encouraged if the Squid server
is considered a critical business system. See
http://wiki.squid-cache.org/SquidFaq/RAID.

> 6. Regex is best avoided

If you want to use regex on URLs to filter access, consider a URL filter.

7. use noatime and nodiratime mount options

8 Specific for Linux:
Add to /etc/sysctl.conf the following lines:
# swappiness can have a value of between 0 and 100
# swappiness=0 tells the kernel to avoid swapping processes out of physical
# memory for as long as possible
# swappiness=100 tells the kernel to aggressively swap processes out of
# physical memory and move them to swap cache
# default: 60
# For an application server we use a less aggressive setting of 20.
vm.swappiness=20

# VFS cache pressure:
# default: 100
# With values lower than 100, the data cache is reduced more and the
# inode cache preserved
vm.vfs_cache_pressure=50

# Overcommit or not memory allocations:
# 2 Don't overcommit. The total address space commit
# the system is not permitted to exceed swap + a
# percentage (default is 50) of physical RAM.
# on the percentage you use, in most situations
# means a process will not be killed while accessing
# but will receive errors on memory allocation as
# appropriate.
# Also ensure that the size of swap is at least 50%
# of physical RAM with a minimum of 2 GB.
vm.overcommit_memory=2

Run the following command to make the new configuration active:
# sysctl -p /etc/sysctl.conf

9. adding disk was already mentioned but may not be omitted in a list.

Marcus

> Regards,
> HASSAN
>
>
>
> On 2010-08-07, Mike Diggins <mike.diggins_at_mcmaster.ca> wrote:
>> I'm setting up a RHEL 5.3 64-bit Squid installation using
>> squid-2.7.STABLE9. It's not a high volume server, and there will be two,
>> but I wondered if there was anything special I should do with the cache
>> disk, which is an EXT3 file system. I do mount it with the noatime option.
>>
>> I'm using AUFS with this cache_dir configuration:
>> cache_dir aufs /usr/local/squid/var/cache 20000 16 256
>>
>> My file system is mounted:
>> LABEL=/cache /usr/local/squid/var/cache ext3
>> rw,noatime 1 2
>>
>> I'm not sure the model of the disk, but it's:
>> 73GB 15K RPM SA SCSI 6Gbps 2.5in (Dell system)
>>
>> Any suggestions (besides adding more disk!).
>>
>> -Mike
>>
>
Received on Sun Aug 08 2010 - 13:42:55 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 09 2010 - 12:00:01 MDT