Re: [squid-users] Squid v3.4.6 SMP errors

From: Mike <mcsnv96_at_afo.net>
Date: Wed, 09 Jul 2014 15:42:32 -0500

Running into this issue on one powerful system. OS (Scientific Linux
6.5) sees 16 CPU cores (which is 2 CPU sockets, each with 4 cores +
Hyperthreading). The unusual part is that this same setup works fine on
another system with dual core + HT using 3 workers.

I tried to setup the SMP options in squid.conf which work on other
systems but not this one. I first tried with 7 workers, then 3 but
neither worked, continued getting the error mentioned at the bottom of
this message. Only if I use the standard cache setup, it works without a
problem. I use odd numbers with the cpu_affinity_map so the parent-coord
can use the first core, and then the kids will be tied to the other
cores mentioned. This allows more single affinity processes to use the
first core as needed with minimal i/o impact.
The /var/cache/squid (and all subfolders) shows ownership as squid:squid
Also worth a mention: selinux is disabled.

Squid.conf basics with ssl-bump:

####
http_port 8080
# above port is what will be used for SSL Proxy on client browser
http_port 8081 intercept
https_port 8082 intercept ssl-bump connection-auth=off
generate-host-certificates=on dynamic_cert_mem_cache_size=16MB
cert=/etc/squid/ssl/squid.pem key=/etc/squid/ssl/squid.key
cipher=ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:AES128-SHA:RC4-SHA:HIGH:!aNULL:!MD5:!ADH

sslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/lib/squid_ssl_db -M 16MB
sslcrtd_children 50 startup=5 idle=1
ssl_bump server-first all
ssl_bump none localhost
cache_log /var/log/squid/cache.log
cache_effective_user squid
debug_options ALL,0
logfile_rotate 10
cache_mgr zzzzz_at_zzzzz.net
pinger_enable off
####
The SMP related items since everything else is fairly standard, here are
2 options I tried:

workers 3
cpu_affinity_map process_numbers=1,2,3 cores=2,3,4

workers 7
cpu_affinity_map process_numbers=1,2,3,4,5,6,7 cores=2,3,4,9,10,11,12

I used cores 2-4 and 9-12, since 5-8 is the first CPU Hyperthread cores.
CPU0 - core: 1-4, HT: 5-8
CPU1 - core: 9-12, HT: 13-16

and the related cache_dir entries, with "workers 7" had process number
up to 8 in the same manner (1 for coord, 7 for workers). Showing it as
commented since that is how it currently sits:

#if ${process_number} = 1
#cache_dir ufs /var/cache/squid/1 10000 32 512
#endif

#if ${process_number} = 2
#cache_dir ufs /var/cache/squid/2 10000 32 512
#endif

#if ${process_number} = 3
#cache_dir ufs /var/cache/squid/3 10000 32 512
#endif

#if ${process_number} = 4
#cache_dir ufs /var/cache/squid/4 10000 32 512
#endif

The error:

(squid-coord-8): Ipc::Mem::Segment::attach failed to
mmap(/squid-squid-page-pool.shm): (22) Invalid argument

Which then kills the squid kid processes resulting in "process 1234 will
not be restarted due to repeated, frequent failures"

Now I saw mentions on the squid page
http://wiki.squid-cache.org/Features/SmpScale
with this info, which did not work:

Add the following line to your */etc/fstab file*:

shm /dev/shm tmpfs nodev,nosuid,noexec 0 0

After that use (as root):

mount shm

The only other thing I can think of is for process_numbers, does that
need to count to workers +1 (for the coord/parent)? So 4 or 8 in my
case? I have it as 3 on another working system with no problems.
Any help is greatly appreciated.

Mike
Received on Wed Jul 09 2014 - 20:42:37 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 10 2014 - 12:00:06 MDT