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

2014-07-10 Thread Alex Rousskov
On 07/09/2014 02:42 PM, Mike wrote:

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

If there are no other errors before that, try stracing Squid and its
kids (one strace file per kid). The problem may be happening _before_
the mmap() system call mentioned above, and the error code may be more
specific at that point. Post the relevant strace tail if you can.

BTW, cpu_affinity_map and the exact number of workers are most likely
unrelated to this issue. Something in your environment screws up shared
memory operations.


Cheers,

Alex.



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

2014-07-09 Thread Mike
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 zz...@z.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 1 32 512
#endif

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

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

#if ${process_number} = 4
#cache_dir ufs /var/cache/squid/4 1 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/shmtmpfsnodev,nosuid,noexec00

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