Re: [squid-users] Re: Squid 3.3.2 and SMP

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 08 Mar 2013 23:50:45 -0700

On 03/08/2013 08:30 PM, Ahmad wrote:

> @alex , you said that just add the "workers" in squid.conf ??

Yes, adding "workers 2" (or similar) to squid.conf will turn on SMP
features.

> how many workers do i need?

It depends on many factors such as your hardware, core hyper-threading,
offered load, disk caching needs, and other system needs (such as
processing network interrupts). It is a complex question, and there is
no formula that works for all cases.

However, starting with 2 workers and making sure everything works is
often a good idea. Keep in mind that not all Squid features are
SMP-aware (the SmpScale wiki page attempts to document what workers can
and cannot share): http://wiki.squid-cache.org/Features/SmpScale

Once you got basic SMP working, using one worker for each otherwise idle
CPU core (with cpu_affinity_map) is often (but not always) a good idea.

> # Uncomment and adjust the following to add a disk cache directory.
> cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256

Ufs cache_dir is one of those SMP-unaware features. You cannot use a ufs
cache_dir in SMP configuration without protecting it with SMP macros in
squid.conf (and that trick will not allow workers to share the disk
cache so it is only a hack that does not work well in many deployment
enviroments).

Consider using Rock store and/or shared memory caching instead if you
can: http://wiki.squid-cache.org/Features/RockStore

> what do i need to modify with it to get maximum cpu usage ??

Become a SETI node? :-)

I assume you want to maximize Squid speed, not CPU usage. You can start
with two workers and increase their number until Squid response time
does not go down any more. Use cpu_affinity_map in squid.conf. Leave
Cpu0 "for the OS". Be careful not to put two busy workers on sibling
hyper-cores. This is just a sketch of an optimization algorithm. There
are many details that depend on your setup.

> @alex
> also , i noted that u enclosed two files in
> http://pastebin.com/dbXNEj5F
>
> what about the 2nd file ??

Sorry, I do not know what you mean or what those file are. I did not
enclose anything on this thread IIRC.

HTH,

Alex.
Received on Sat Mar 09 2013 - 06:50:57 MST

This archive was generated by hypermail 2.2.0 : Sat Mar 09 2013 - 12:00:04 MST