Re: [squid-users] SMP vs Single Process Performance

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 18 Mar 2013 17:26:39 -0600

On 03/18/2013 02:46 AM, Sokvantha YOUK wrote:

> I am going to build squid to supports 1 Gbps traffic on Centos 6 x64
> bits. I have done some studying on getting squid to support this high
> load traffic but I still not clear on some points below

> 1. Should I use SMP feature with 6 workers support and AUFS file system?

You must use SMP IMO. The exact number of workers will depend on many
factors, but 4-6 workers is a good starting point, provided you have at
least 6-8 true CPU cores (not hyperthreaded ones). Start by making sure
everything works at Gbit speeds without caching (if needed, you may use
smaller artificial delays on the server side of your workload to
approximate caching effects during these initial non-caching tests).

As for caching, your options include:

0) Memory caching only: very fast but small cache size and limited to
32KB response sizes if shared among workers.

1) Rock store only: fast but limited to 32KB.

2) Large Rock: unlimited file sizes on disk and in RAM but requires
using an unofficial Launchpad branch that needs recent trunk updates.

3) Aufs: Use it if you have to cache objects larger than 32KB on disk
and cannot use #2. Aufs is not SMP-aware, so you will be creating a lot
of duplication and waste. Those overheads may or may not offset caching
gains. You can try aufs in combination with small rock (#1 above). Some
report success with this option -- see other responses on this thread.

In all cases except #0, please note that you will need your total disk
speed to match that of cachable traffic. For example, if 50% of content
is cachable, you will need enough disk spindles to support about
500Mbit/s worth of disk traffic not counting hits. That is about 5000
responses per second swapping out to disk (assuming 13KByte mean
response size). Depending on your mean disk I/O response time, you may
need dozens of disk spindles to sustain that!

Most likely, you will end up caching less than 1Gbit/sec, which means
you need to limit disk I/O. Rock has options to control disk I/O rate so
that you do not overwhelm your disks (see squid.conf.documented). AUFS
may have something like that too.

Finally, when doing performance testing, do not be fooled by excellent
results during the first two hours of the test. Wait until your disks
become full to see what disk seeks will do to your overall disk throughput.

> 2. Or single squid process provide better performance and reliable against SMP?

I doubt it is possible to get Gbit/s performance with a single Squid3
worker while handling typical web traffic but YMMV.

HTH,

Alex.
Received on Mon Mar 18 2013 - 23:26:42 MDT

This archive was generated by hypermail 2.2.0 : Tue Mar 19 2013 - 12:00:06 MDT