[squid-users] SMP mode, workers, cache_dir with conditional

Amos Jeffries squid3 at treenet.co.nz
Wed Oct 10 15:10:26 UTC 2018


On 11/10/18 3:01 AM, juju wrote:
> Hello,
> Sorry if this question has already been posted ( I can't check as the
> "Search Function" is currently not working )
> I'm running squid-3.5.20 on Amazon Linux 2018.03. 2 cores with 8 GB
> My squid is currently working but only on 1 core.
> I which to use the 2 cores. I understood that I have to use workers in
> squid.conf with separate cache directory.

This is not quite correct.

Per-worker configuration is only required for features which are not yet
SMP-aware.

The rock cache type *is* SMP-aware, so one directory can be shared by
workers.

The UFS/AUFS/diskd cache types are not SMP-aware yet, so they do need
separate directories per-worker currently.



Since you are using only rock type caches you do not have to do anything
special for SMP to work.


> So I modified default  squid.conf  with :
> ---
...
> workers 2
> if ${process_number} = 1
> cache_dir rock /var/spool/squid1 1024
> endif
> if ${process_number} = 2
> cache_dir rock /var/spool/squid2 1024
> endif
...
> 
> ---
> but
> /var/log/squid/squid.out :
> [...]
> 2018/10/10 13:52:15 kid3| Set Current Directory to /var/spool/squid
> 2018/10/10 13:52:15 kid2| Set Current Directory to /var/spool/squid
> 2018/10/10 13:52:15 kid1| Set Current Directory to /var/spool/squid
> 2018/10/10 13:52:15 kid2| Creating missing swap directories
> 2018/10/10 13:52:15 kid1| Creating missing swap directories
> 2018/10/10 13:52:15 kid3| Creating missing swap directories
> 2018/10/10 13:52:15 kid3| No cache_dir stores are configured    <------

Notice the kid (process) numbers in those log lines.

You only defined cache directories for process #1 and #2. This line is
being reported by process #3 - which is the process coordinator process.
So it is correct for your config.

Also, this is informative message - not an error.


Amos



More information about the squid-users mailing list