禁止在 Squid 中复活已死亡的同伴

禁止在 Squid 中复活已死亡的同伴

如何操作,我正在使用 Squid v3.3.8,我需要创建 HTTP 旋转代理服务器来通过一组预定义代理发送所有请求(我正在自动更新 squid 配置以更新一组工作代理)。

我的输出代理不够快也不可靠,所以如果其中一些代理响应不够快,我不希望 squid 等待,我最好希望其他代理更好,并且永远不要回到有问题的代理。

我的配置如下

# 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

这是我所看到的缓存日志

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

问题是我不希望我死去的父母复活(是的,听起来很奇怪)。

而且我也不太清楚 squid 如何检测我的对等端是否宕机。我禁用了ICP查询通过设置选项为每个对等点no-query提供端口 0,但dead_peer_timeout它仍然认为我的对等点在超时后已经死亡,尽管它正在使用电感耦合等离子体 根据文档

更新:添加squid -v输出:

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'

相关内容