2

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.

3
  • What CPU do you have? Aug 1, 2013 at 2:33
  • Intel(R) Xeon(R) CPU E5506 @ 2.13GHz but I wouldn't want an answer based on this cpu as I will need this for other machines as well. Aug 1, 2013 at 2:37
  • you can try the lscpu if available to you for listing the cpus. I sometimes find that output easier to read.
    – Petter H
    Aug 1, 2013 at 9:16

1 Answer 1

1

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.

3
  • So I basically have to avoid using the whole number of CPUs when I have hyper threading CPUs? Aug 1, 2013 at 2:45
  • @RomeoMihalcea: According to some random guy in a conversation that you quoted. Aug 1, 2013 at 2:57
  • cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l found this to show the cores after removing the hyperthreading ones. Thanks. I'm left with testing things out from now. Aug 1, 2013 at 3:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .