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

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 27 Oct 2013 14:23:50 -0600

On 10/27/2013 02:58 AM, Ahmad wrote:

> 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:

The number of Squid processes in a single Squid instance started without
a -N command-line option usually is:

+ 1 master process (counted only in SMP mode) plus
+ W workers (workers in squid.conf; defaults to 1) plus
+ D diskers (rock cache_dirs in squid.conf; defaults to 0) plus
+ 1 Coordinator process (exists only in SMP mode).

The terms used above (and in my earlier emails) are defined below.

For example, if you do not explicitly configure Squid workers and rock
cache_dirs, then Squid will run in non-SMP mode and you will get
0+1+0+0=1 Squid process total.

For example, if you explicitly configure Squid with 1 worker and 3 rock
cache_dirs, then Squid will run in SMP mode and you will get 1+1+3+1=6
Squid processes total.

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

Please see the definitions below.

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

Sorry, I do not understand this question. Please rephrase, but keep in
mind that a busy Squid diskers are blocked on disk I/O most of the time
while workers usually consume a lot of CPU cycles (and should virtually
never be blocked until Squid becomes overloaded).

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

The master process (defined below) interprets squid.conf first.

And here are the definitions of the terms I have been using:

Instance: All processes running as a result of a single "squid" command.
This includes, but is not limited to, kid processes defined below.

Kid: A Squid process (i.e., a process running Squid executable code)
created by the Master process. Coordinator, worker, and diskers defined
below are often Squid kids.

Worker: A Squid process accepting HTTP or HTTPS requests. Workers are
usually created by the Master process. In general, workers are
responsible for most transaction processing but may outsource some of
their work to helpers (directly), other workers (via Coordinator), or
even independent servers (via ICAP, DNS, etc).

Disker: A Squid process dedicated to cache_dir I/O. Diskers are created
by the Master process. Today, only Rock cache_dirs may use diskers.

Coordinator: A Squid process dedicated to synchronizing other kids.

Master: The first Squid process created when you run a "squid" command.
The Master process is responsible for starting and restarting all kids.
This definition is not 100% accurate because the OS creates the first
process and that first Squid process then forks the actual Master
process to become a daemon (except for "squid -N"). Since that first
OS-created process exits immediately after fork, this inaccurate
definition works OK for most purposes. Better wording is welcomed!

SMP mode: Squid is said to be working in SMP mode when the sum of the
number of worker and disker processes exceeds one. Here are three randm
examples of a Squid instance working in SMP mode: 2 workers and 0
diskers; 1 worker and 1 disker; 2 workers and 3 diskers. Sometimes, the
same "SMP mode" term is used to mean "multiple workers"; that usage
excludes configurations with a single worker and multiple diskers; such
usage should be avoided.

Please note that the same process may play multiple roles. For example,
when you start Squid with the -N command line option, there will be only
one Squid process running and that single process plays the roles of
Master and Worker.

Finally, please note that others may use different definitions.

HTH,

Alex.
Received on Sun Oct 27 2013 - 20:23:57 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 28 2013 - 12:00:12 MDT