Squid workers and server cpus

squid

Allright so I'm about to upgrade my box (with 2k external ips) to the latest squid (3.3.x) since my old version do not take any advantage of the multi-core processors.

While researching on the workers I found a discussion where someone says:

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.

I also understand that it's best to use as many workers as you have CPUs:

FWIW, we usually see best performance results when using
cpu_affinity_map with 1:1 mapping between workers and cores (which
effectively disables those complex algorithms as far as Squid workers
are concerned).

My question is…it's that physical CPUs? My box reports 8 cpus but only 2 physical shown when I run cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l so that means 2 workers?

If I put 2 workers on 2 physical CPUs how does Leave Cpu0 "for the OS" fits? This means I set only 1 worker for cpu1 while OS uses cpu0?

P.S. I know about cpu afinity. I just need a clarification about how to find out exactly how many workers I can use before I lose poerformance.

Best Answer

You have two Xeon E5506 CPUs with 8 cores total. The E5506 has no hyper-threading. You could run seven workers and still have an free core for the OS.

Related Topic