Whether to lookup the EUI or MAC address of a connected client.
DOC_END
-NAME: main_processes
+NAME: workers
TYPE: int
-LOC: Config.main_processes
+LOC: Config.workers
DEFAULT: 1
DOC_START
- Number of main Squid processes to fork.
+ Number of main Squid processes or "workers" to fork and maintain.
0: "no daemon" mode, like running "squid -N ..."
1: "no SMP" mode, start one main Squid process daemon (default)
- N: start N main Squid process daemons
+ N: start N main Squid process daemons (i.e., SMP mode)
+
+ In SMP mode, each worker does nearly all what a single Squid daemon
+ does (e.g., listen on http_port and forward HTTP requests).
DOC_END
EOF
Config2.onoff.enable_purge = 2;
// parse the config returns a count of errors encountered.
- const int oldMainProcesses = Config.main_processes;
+ const int oldWorkers = Config.workers;
if ( parseConfigFile(ConfigFile) != 0) {
// for now any errors are a fatal condition...
self_destruct();
}
- if (oldMainProcesses != Config.main_processes) {
- debugs(1, DBG_CRITICAL, "WARNING: Changing 'main_processes' (from " <<
- oldMainProcesses << " to " << Config.main_processes <<
+ if (oldWorkers != Config.workers) {
+ debugs(1, DBG_CRITICAL, "WARNING: Changing 'workers' (from " <<
+ oldWorkers << " to " << Config.workers <<
") is not supported and ignored");
- Config.main_processes = oldMainProcesses;
+ Config.workers = oldWorkers;
}
setUmask(Config.umask);
return 0;
}
- if (!opt_no_daemon && Config.main_processes > 0)
+ if (!opt_no_daemon && Config.workers > 0)
watch_child(argv);
setMaxFD();
dup2(nullfd, 2);
}
- if (Config.main_processes > 128) {
- syslog(LOG_ALERT, "Suspiciously high main_processes value: %d",
- Config.main_processes);
+ if (Config.workers > 128) {
+ syslog(LOG_ALERT, "Suspiciously high workers value: %d",
+ Config.workers);
// but we keep going in hope that user knows best
}
- TheKids.init(Config.main_processes);
+ TheKids.init(Config.workers);
// keep [re]starting kids until it is time to quit
for (;;) {
char *accept_filter;
int umask;
- int main_processes;
+ int workers;
#if USE_LOADABLE_MODULES
wordlist *loadable_module_names;
IamWorkerProcess()
{
// when there is only one process, it has to be the worker
- if (opt_no_daemon || Config.main_processes == 0)
+ if (opt_no_daemon || Config.workers == 0)
return true;
- return 0 < KidIdentifier && KidIdentifier <= Config.main_processes;
+ return 0 < KidIdentifier && KidIdentifier <= Config.workers;
}
bool
UsingSmp()
{
- return !opt_no_daemon && Config.main_processes > 1;
+ return !opt_no_daemon && Config.workers > 1;
}
bool
IamCoordinatorProcess()
{
- return UsingSmp() && KidIdentifier == Config.main_processes + 1;
+ return UsingSmp() && KidIdentifier == Config.workers + 1;
}
bool
IamPrimaryProcess()
{
// when there is only one process, it has to be primary
- if (opt_no_daemon || Config.main_processes == 0)
+ if (opt_no_daemon || Config.workers == 0)
return true;
// when there is a master and worker process, the master delegates
// primary functions to its only kid
- if (Config.main_processes == 1)
+ if (Config.workers == 1)
return IamWorkerProcess();
// in SMP mode, multiple kids delegate primary functions to the coordinator