Re: [squid-users] Squid optimize settings

From: Henrik Nordstrom <>
Date: Thu, 12 Feb 2004 13:43:36 +0100 (CET)

On Thu, 12 Feb 2004, Peter van der Does wrote:

> Now use as much cache_mem as you can, that really makes a difference.

The general recommendation is to not use very much cache_mem with the
exception if your are running a reverse proxy/accelerator. All benchmarks
indicate this only gives marginal benefits in a normal Internet proxy
and the memory is usually better spent on being able to have a large

See the Squid FAQ on memory usage for details.

> Don't use all your memory for caching. I remember reading you should use
> half of your free memory but I can't remember on what site I read that.

The general recommendation is to have twice the amount of physical memory
to what the rule of thumb says Squid will use.

> Our filesystem is EXT3, as far as I read it's better to use ReiserFS
> altho people differ on that as well.

In all results I have sen Reiserfs wins on speed, but not with a very
large margin.

> In follow-up to Henrik's mail:
> We used diskd at first but afer switchting to aufs the system became
> more stable.

To use diskd you must configure the system properly as per the
requirements for using diskd (see the Squid FAQ). If not it will be very

> We are not running the cache on a separate drive but that would surely
> make a difference.

Since you only have a very small local cache and a lot of memory I would
recommend you to run with no disk cache at all. This makes a huge
difference in performance. See the null cache_dir type.

> The first implementation of the linux system could have been better, if
> we would have set up a new squid machine we would make that change as
> well.

It is alway good to select the proper hardware for the job. Most people
setting up their first Squid go with hardware suitable for a normal
fileserver has somewhat different requirements than Squid.

For a high performance Squid you want

 * A single fast CPU. SMP is not of any use for Squid.
 * Several harddrives. The seek time is the first bottleneck you will run
into and the most cost effective way of optimizing seek time is to add
more harddrives (two drives seek twice as fast as one).
 * No RAID for the cache drives. Certainly not RAID5. But with a good RAID
controller there is no problem from the RAID until you reach around
150-200 req/s on a 5-drive RAID5.
 * Plenty of memory as per the memory usage guidelines in the FAQ.

Note: There is a upper limit on how large Squid you can build on most
hardware. It is not practical to plan a Squid where the Squid memory usage
will go above 2 GB. But at the same time there is no noticeable benefits
in cache hit ratio in storing more than 1 weeks worth of content so this
limitation isn't really a problem assuming one is willing to accept that
the harddrives may be too large and can not be fully used.

Received on Thu Feb 12 2004 - 05:44:01 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:02 MST