How, I'm using Squid v3.3.8 and I need to create HTTP rotating proxy server to send all requests through set of predefined proxies (I'm automatically updating squid config to update set of working proxies).
My output proxies are not fast and reliable, so I don't want for squid to wait if some of them don't respond fast, I better hope that other are better and never go back to problematic ones.
So this is how my config looks like
# Basic configuration
visible_hostname squid_1
unique_hostname squid_1
http_port 3130
pid_filename /home/vagrant/projects/squid_1.pid
dns_v4_first on
peer_connect_timeout 3 seconds
dead_peer_timeout 3 seconds
server_persistent_connections off
http_access allow all
# Proxies list
cache_peer PROXY_HOST parent PROXY_PORT 0 connect-fail-limit=1 round-robin no-query name=node2447551878 login=login2447551878:PASSWORD
cache_peer PROXY_HOST parent PROXY_PORT 0 connect-fail-limit=1 round-robin no-query name=node3119927090 login=login3119927090:PASSWORD
cache_peer PROXY_HOST parent PROXY_PORT 0 connect-fail-limit=1 round-robin no-query name=node4682855833 login=login4682855833:PASSWORD
cache_peer PROXY_HOST parent PROXY_PORT 0 connect-fail-limit=1 round-robin no-query name=node9428960235 login=login9428960235:PASSWORD
cache_peer PROXY_HOST parent PROXY_PORT 0 connect-fail-limit=1 round-robin no-query name=node3796185266 login=login3796185266:PASSWORD
never_direct allow all
And this is what I see in cache.log
2016/04/20 15:28:49 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:28:49 kid1| Detected DEAD Parent: node3796185266
2016/04/20 15:28:49 kid1| Detected REVIVED Parent: node3796185266
2016/04/20 15:28:53 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:28:53 kid1| Detected DEAD Parent: node3796185266
2016/04/20 15:28:53 kid1| Detected REVIVED Parent: node3796185266
2016/04/20 15:28:57 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:28:57 kid1| Detected DEAD Parent: node3796185266
2016/04/20 15:28:57 kid1| Detected REVIVED Parent: node3796185266
2016/04/20 15:29:06 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:29:06 kid1| Detected DEAD Parent: node9428960235
2016/04/20 15:29:06 kid1| Detected REVIVED Parent: node9428960235
2016/04/20 15:29:10 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:29:10 kid1| Detected DEAD Parent: node3796185266
2016/04/20 15:29:10 kid1| Detected REVIVED Parent: node3796185266
2016/04/20 15:29:14 kid1| TCP connection PROXY_HOST/PROXY_PORT failed
2016/04/20 15:29:14 kid1| Detected DEAD Parent: node3796185266
2016/04/20 15:29:14 kid1| Detected REVIVED Parent: node3796185266
The problem is that I don't want my DEAD parents to be revived ever (yup, sounds weird).
And also I'm not really sure about how squid detects if my peer is down. I disabled ICP queries for every peer by setting no-query
option and provided port 0, but dead_peer_timeout
is still thinks my peers are dead after timeout, despite it is using ICP according to the docs.
UPDATE: Added squid -v
output:
Squid Cache: Version 3.3.8
Ubuntu
configure options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' '--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3' '--mandir=/usr/share/man' '--enable-inline' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-underscores' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,smb_lm' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid3' '--with-logdir=/var/log/squid3' '--with-pidfile=/var/run/squid3.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security'