[squid-dev] SMP scaling in no_daemon mode?

Amos Jeffries squid3 at treenet.co.nz
Fri Jun 16 11:11:04 UTC 2017


On 16/06/17 18:32, Andreas Weigel wrote:
> Hi Alex,
>
> any chances this could be considered a bug or stability fix (as in the 
> v4 roadmap's "additions are limited to") and apply it to v4 as well? :)
>

By changing the v4 release notes I assumed an implicit request for 
backporting.

However, the content of that change is enough for me to -1 veto this patch.

It is explicitly adding a regression in a very necessary behaviour for 
startup sequences running what is effectively "squid --foreground -z && 
squid". We will regress to the state of having race conditions as 
multiple independent sets of workers are spawned and collide with each 
others /dev/shm and whether or not the disk cache is formatted before 
Squid starts accepting client connections.

The original notes wording (and --foreground design) was intended to be 
clear that in that made a Squid SMP-enabled instance operate as a 
consistent / atomic whole. **No background parts still operating after 
the main process exit()'s**.


Also, there are (or will be) installations containing "squid 
--foreground -N " due to the way some OS provide default options (using 
the new --foreground by default) and allow admin to extend them in a 
separate config file (usually with -N hacks from legacy installs).

  - the updated documentation implies that --foreground actively creates 
workers. Which will leave anyone with that config confused about what 
happens if they are both required (--foreground "and creates worker 
kids") and prohibited (-N). Yet Squid runs with nary a message about 
problems.


I am quite surprised you did not hit these issues yourself already. 
Perhapse you are not using sufficiently large (or slow) disk caches to 
see the race condition?

Amos


> Regards,
> Andreas
>
> On 15.06.2017 17:35, Alex Rousskov wrote:
>> On 06/15/2017 04:57 AM, Andreas Weigel wrote:
>>>  From discussion on squid-dev, the following behavior is implemented by
>>> this patch:
>>>
>>> * -N: The initial process is a master and a worker process.
>>>    No kids.
>>>    No daemonimization.
>>>
>>> * --foreground: The initial process is the master process.
>>>    One or more worker kids (depending on workers=N).
>>>    No daemonimization.
>>>
>>> * neither: The initial process double-forks the master process.
>>>    One or more worker kids (depending on workers=N).
>>>    Daemonimization.
>>>
>>> The Release Notes for v4 were updated to reflect the corrected 
>>> behavior.
>> I appreciate you making this revision despite our disagreement regarding
>> the appropriateness of renaming/polishing changes in this patch.
>>
>> I will commit this revised patch to v5 if there are no objections.
>>
>>
>> Thank you,
>>
>> Alex.
>



More information about the squid-dev mailing list