Re: [squid-users] something not being understood in ,workers , squid proces , cores mapping

From: Amos Jeffries <>
Date: Mon, 28 Oct 2013 00:58:42 +1300

On 27/10/2013 9:58 p.m., Ahmad wrote:
> hi ,
> about smp and workers
> ,
> just want to understand
> 1- i want an equation that equal the number of instances for squid relative
> with cache dir and worker number ???
> ex:
> With 3 workers and 1 rock cache = 5 processes running:
> i want general fourm for this above

"Sum of all componentes configured which cause instances to start" is
the closest we can give in the way of general formula.

Squid has not been a single-process system since v2.0, possibly earlier.
There are always background helper processes doing things for some
component or another. The new Disker processes are equivalent to the old
cache_dir diskd helpers but for rock storage format and are SMP-aware.
Also, it *will* be changing as new SMP support is added/modified.

Get your configuration working the way you want it to go before trying
to tune instances to cores. By that time you should have cache.log
records to identify what each process number is doing to base the
affinity on.

The SMP macros and if-else-endif should always be treated with care and
used as sparingly as possible. They are temporary workarounds for the
current incomplete or missing SMP support of some components, and we
expect to break configurations that use them in future as SMP-support

> ===========================================================================
> 2-wts the difference between squid instance and worker ???

"squid instance" is a fuzzy term. Its meaning changes depending on
whether you enabled SMP mode or non-SMP mode, or debug non-daemon mode.
I think of it as meaning any instance of process running out of the
"squid" binary.

worker is a specific type of squid instance....

> im
> misunderstanding !! why its better to give worker a core not like cores of
> "rock disk" ???

... worker process does all HTTP I/O and protocol handling. Currently
they also do a lot of non-HTTP protocols actions like SNMP. But that is
planned to change eventually.

> isnt worker is squid instance ??!!!

Yes. Worker is a type of squid instance.

> 3-which will scan and read squid.conf first , is it the instance of squid ??
> or the worker of squid ??

The first one to read the config file is something else you may not have
noticed yet. The first instance of squid binary to run is the daemon
manager. It reads the config file and determines how many processes to
fork into (if any). The result is all the kidN processes, forked at
different times as determined by the configuration.
  It then performs the high-availability monitoring to ensure that
either the coordinator (SMP-mode) or the single worker process (non-SMP
mode) always stays running.

FYI: this design is one reason why Squid is so unfriendly with upstart
and systemd. They try to be daemon managers themselves, and things dont
work well if you have two managers giving conflicting HA instructions to
a set of processes (one manager says shutdown, the other notices outage
and auto-starts a replacement ... etc, etc). Or one manager is managing
the other, which has no useful effects.

Received on Sun Oct 27 2013 - 11:58:58 MDT

This archive was generated by hypermail 2.2.0 : Sun Oct 27 2013 - 12:00:06 MDT