squid - kid registration timed out

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

squid - kid registration timed out

carlos
Hi all,

I m new to squid and i m installing it i na RHEL 7.4, squid version 3.5.20.

I have a setup with 3 squid instances listening in 3 diferent ports (but
other than they are basically the same), each instance have 4 workers.

The problem is when i restart the squid ou after some random time i get :

in cache log:
FATAL: kid3 registration timed out
Squid Cache (Version 3.5.20): Terminated abnormally.
CPU Usage: 0.030 seconds = 0.020 user + 0.010 sys
Maximum Resident Size: 67648 KB
Page faults with physical i/o: 0

in messages log:
 (squid-3): kid3 registration timed out
squid[32613]: Squid Parent: (squid-3) process 32697 exited with status 1
Squid Parent: (squid-3) process 32697 will not be restarted due to repeated,
frequent failures

The squid other than that is working as aspected.

I read in some post that they pointed to:

https://wiki.squid-cache.org/Features/SmpScale
net.local.dgram.recvspace: 262144
net.local.dgram.maxdgram: 16384

These parameters seems to be FreeBSD, and do not exists in RHEL, anyone had
this problem in RHEL? How to solve it?

the most near/relevant parameters that i found are:
        cat /proc/sys/net/core/rmem_max
        cat /proc/sys/net/core/wmem_max
     cat /proc/sys/net/unix/max_dgram_qlen

Any idea if they will solve? or any recommended value?

NOTE: not using cache (deny cache all)

Chears,
Carlos



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

Amos Jeffries
Administrator
On 01/12/17 07:32, carlos wrote:
> Hi all,
>
> I m new to squid and i m installing it i na RHEL 7.4, squid version 3.5.20.
>
> I have a setup with 3 squid instances listening in 3 diferent ports (but
> other than they are basically the same), each instance have 4 workers.
>

By "basically the same" I hope you have accounted for all the directives
mentioned in <https://wiki.squid-cache.org/MultipleInstances> which have
mandatory differences.


> The problem is when i restart the squid ou after some random time i get :
>
> in cache log:
> FATAL: kid3 registration timed out
> Squid Cache (Version 3.5.20): Terminated abnormally.
> CPU Usage: 0.030 seconds = 0.020 user + 0.010 sys
> Maximum Resident Size: 67648 KB
> Page faults with physical i/o: 0
>
> in messages log:
>   (squid-3): kid3 registration timed out

The worker is taking too long to startup. Something you have configured
(or not configured correctly) is making the process too long for the SMP
coordinator to cope with.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

carlos
Hi Amos,

Yes i think i did all the adjustments, different pid file, log dirs,
proccess names, listening port...

it also happens after startup, sometimes after a random time, load is not
the problem since the server is not taking requests yet.

The config is this (i swapped real values for X):

acl all src all
acl SSL_ports port X X X
acl Safe_ports port X-X
acl CONNECT method CONNECT

http_access allow CONNECT SSL_ports all
http_access allow CONNECT Safe_ports all

acl ftp proto FTP
always_direct allow FTP
http_reply_access allow all
http_access allow ftp
icp_access allow all

http_access allow localhost
http_access allow all


pid_filename /var/run/squid.pid

http_port 80

http_access allow manager localhost
http_access deny manager

logfile_rotate 30

visible_hostname squid_8080_${process_number}

cache deny all

logformat access       %{%d-%m-%Y %H:%M:%S}tl.%tu %<pt %<tt %>a %Ss/%03>Hs
%<st %rm %>ru %un %Sh/%<a %mt
access_log /var/log/squid/access8080_${process_number}.log logformat=access
cache_log /var/log/squid/cachelog8080_${process_number}.log

acl XXXX dstdomain xxxxx.zzz
url_rewrite_access allow XXXX
url_rewrite_access deny !XXXX
url_rewrite_program /bin/rewrite


workers 4


Do you see anything wrong?

Thanks,
Carlos



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

Amos Jeffries
Administrator


On 04/12/17 21:58, carlos wrote:

> Hi Amos,
>
> Yes i think i did all the adjustments, different pid file, log dirs,
> proccess names, listening port...
>
> it also happens after startup, sometimes after a random time, load is not
> the problem since the server is not taking requests yet.
>
> The config is this (i swapped real values for X):
>
> acl all src all
> acl SSL_ports port X X X
> acl Safe_ports port X-X
> acl CONNECT method CONNECT
>
> http_access allow CONNECT SSL_ports all
> http_access allow CONNECT Safe_ports all
>
> acl ftp proto FTP
> always_direct allow FTP
> http_reply_access allow all
> http_access allow ftp
> icp_access allow all
>
> http_access allow localhost
> http_access allow all
>
>
> pid_filename /var/run/squid.pid
>
> http_port 80
>
> http_access allow manager localhost
> http_access deny manager
>
> logfile_rotate 30
>
> visible_hostname squid_8080_${process_number}
>
> cache deny all
>
> logformat access       %{%d-%m-%Y %H:%M:%S}tl.%tu %<pt %<tt %>a %Ss/%03>Hs
> %<st %rm %>ru %un %Sh/%<a %mt
> access_log /var/log/squid/access8080_${process_number}.log logformat=access
> cache_log /var/log/squid/cachelog8080_${process_number}.log
>
> acl XXXX dstdomain xxxxx.zzz
> url_rewrite_access allow XXXX
> url_rewrite_access deny !XXXX
> url_rewrite_program /bin/rewrite
>
>
> workers 4
>
>
> Do you see anything wrong?
>


I see a few things that indicate you are confusing instance and process.

"squid" is a daemon manager *already* wrangling a whole collection of
processes
(<https://wiki.squid-cache.org/Features/SmpScale#Terminology>). The
${process_*} macros are a temporary workaround for distinguishing how
those SMP worker processes interpret a config line and has nothing to do
with multi-instance Squid.

To run multiple *instances* with Squid-3+ you need to us the -n command
line option and assign a unique service name to each instance. That must
be used by all scripts and manual commands you run. That is sort of a
weak sandbox for the instances' SMP things to work within. If you omit
that option on the command line you are using the default "squid" namespace.

In squid.conf the ${service_name} macro is replaced with that -n
assigned name to make values for the directives that need to be unique
without having to make multiple squid.conf.

For example; the pid_filename directive default value in Squid-4 has become:
  pid_filename /var/run/${service_name}.pid


If you do not use -n option then the SMP workers will be registering
themselves to the wrong coordinators and re-arranging each others shared
memory spaces randomly. Quite a nasty mess happens.

As a result Squid-3 versions which are SMP-enabled but not supporting -n
service names cannot be used in a multi-instance environment. That means
all Squid-3.1 through 3.4.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

carlos
From your post and like i have 3.5.20 i should fine with this version.

Like i have worker > 1 its an SMP setup , correct?

Probably i should be missing the -n, that config is the config file of the
first instance, the other instance is more or less the same, but:
 pid_filename (/var/run/squid.pid vs /var/run/squid81.pid)
 http_port (80 vs 81)
 visible_hostname (squid_80_${process_number} vs squid_81_${process_number})
 access_log (/var/log/squid-80/access80_${process_number} vs
/var/log/squid-81/access81_${process_number} )
 cache_log (/var/log/squid-80/cachelog80_${process_number} vs
/var/log/squid-81/cachelog81_${process_number})

In RHEL i start squid with systemctl start squid.service and  systemctl
start squid81.service.
This is multi-instance, correct?
i think i followed https://wiki.squid-cache.org/MultipleInstances.

Can you confirm that in squid config is OK? You pointed to me "-n" i don't
have it anywere...

In /usr/lib/systemd/system/squid.service (i have another squid81.service) i
have:
...
 EnvironmentFile=/etc/sysconfig/squid
 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF
...

the EnvironmentFile:
# default squid options
SQUID_OPTS=""
...
# default squid conf file
SQUID_CONF="/etc/squid/squid.conf"


If understood what you said i must put in SQUID_OPTS "-n squid" and "-n
squid81" in the other instance startup script.

Did i understand correctly?

Thanks,
Carlos






--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

Alex Rousskov
On 12/04/2017 12:04 PM, carlos wrote:

> Like i have worker > 1 its an SMP setup , correct?

Correct. "worker > 1" is sufficient (but not necessary) to enable SMP.


> Probably i should be missing the -n

The -n command line option is essentially required to run multiple SMP
instances using the same Squid binary. -n can also make it easier for
multiple SMP instances to share the same squid.conf, but that
simplification is a side effect.


> that config is the config file of the
> first instance, the other instance is more or less the same, but:
>  pid_filename (/var/run/squid.pid vs /var/run/squid81.pid)
>  http_port (80 vs 81)
>  visible_hostname (squid_80_${process_number} vs squid_81_${process_number})
>  access_log (/var/log/squid-80/access80_${process_number} vs
> /var/log/squid-81/access81_${process_number} )
>  cache_log (/var/log/squid-80/cachelog80_${process_number} vs
> /var/log/squid-81/cachelog81_${process_number})

FYI: You may be able to use the same squid.conf for both instances if
you use something like "-n 80" and "-n 81" to start your two Squid
instances and replace 80 and 81 in squid.conf with ${service_name} as
Amos suggested. Again, that unification is sometimes nice to have, but
-n is actually needed for other reasons -- it affects various SMP paths
that cannot be configured via squid.conf.


> In RHEL i start squid with systemctl start squid.service and  systemctl
> start squid81.service.
> This is multi-instance, correct?

Correct.


> i think i followed https://wiki.squid-cache.org/MultipleInstances.

The SMP section in that document needs adjustment: It currently focuses
on what -n means. It should focus on specifying that -n is *required*
for running multi-instance SMP Squids using the same binary (and
referring elsewhere for -n documentation).


> Can you confirm that in squid config is OK?

It may be OK, but you need -n to make it work.


HTH,

Alex.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid - kid registration timed out

carlos
Hi Alex,

Thanks for the confirmation.

I just added the -n squid80, etc to SQUID_OPTS, now it restart just fine!
I will wait until tomorrow to see if all squid instances have all the
workers, but reading for post it should be solved for sure!

Yes, i can optimize the config using ${service_name}, probably just one
config would be enought.

I totally miss:
Squid-3.5 provides the -n command line option to configure a unique service
name for each Squid instance started. Each set of SMP-aware processes will
interact only with other processes using the same service name. A service
name is always present, the default service name is squid is used when the
-n option is absent from the command line.


Thanks both of you to point me the direction.

Cheers,
Carlos



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users