在具有多个后端的apache反向代理中,请求需要很长时间

在具有多个后端的apache反向代理中,请求需要很长时间,apache,reverse-proxy,vhosts,Apache,Reverse Proxy,Vhosts,我使用Apache2.2.34作为反向代理服务器。有10多个后端。在给定的时间内,只有一个后端服务器工作,并且它们都以循环方式工作/启用。 vhost配置与以下类似 <Proxy balancer://AWSELB> BalancerMember https://backendEC2_1:443/ retry=60 BalancerMember https://backendEC2_2:443/ retry=60 BalancerMember https://backendEC2_3

我使用Apache2.2.34作为反向代理服务器。有10多个后端。在给定的时间内,只有一个后端服务器工作,并且它们都以循环方式工作/启用。 vhost配置与以下类似

<Proxy balancer://AWSELB>
BalancerMember https://backendEC2_1:443/ retry=60
BalancerMember https://backendEC2_2:443/ retry=60
BalancerMember https://backendEC2_3:443/ retry=60
BalancerMember https://backendEC2_4:443/ retry=60
BalancerMember https://backendEC2_5:443/ retry=60
BalancerMember https://backendEC2_6:443/ retry=60
BalancerMember https://backendEC2_7:443/ retry=60
BalancerMember https://backendEC2_8:443/ retry=60
BalancerMember https://backendEC2_9:443/ retry=60
BalancerMember https://backendEC2_10:443/ retry=60    
</Proxy>
ProxyPass / balancer://AWSELB/ forcerecovery=Off timeout=5
ProxyPassReverse / https://backendEC2_1:443/
ProxyPassReverse / https://backendEC2_2:443/
ProxyPassReverse / https://backendEC2_3:443/
ProxyPassReverse / https://backendEC2_4:443/
ProxyPassReverse / https://backendEC2_5:443/
ProxyPassReverse / https://backendEC2_6:443/
ProxyPassReverse / https://backendEC2_7:443/
ProxyPassReverse / https://backendEC2_8:443/
ProxyPassReverse / https://backendEC2_9:443/
ProxyPassReverse / https://backendEC2_10:443/

平衡员https://backendEC2_1:443/ 重试=60
平衡员https://backendEC2_2:443/ 重试=60
平衡员https://backendEC2_3:443/ 重试=60
平衡员https://backendEC2_4:443/ 重试=60
平衡员https://backendEC2_5:443/ 重试=60
平衡员https://backendEC2_6:443/ 重试=60
平衡员https://backendEC2_7:443/ 重试=60
平衡员https://backendEC2_8:443/ 重试=60
平衡员https://backendEC2_9:443/ 重试=60
平衡员https://backendEC2_10:443/ 重试=60
ProxyPass/balancer://AWSELB/ 强制恢复=关闭超时=5
ProxyPassReverse/https://backendEC2_1:443/
ProxyPassReverse/https://backendEC2_2:443/
ProxyPassReverse/https://backendEC2_3:443/
ProxyPassReverse/https://backendEC2_4:443/
ProxyPassReverse/https://backendEC2_5:443/
ProxyPassReverse/https://backendEC2_6:443/
ProxyPassReverse/https://backendEC2_7:443/
ProxyPassReverse/https://backendEC2_8:443/
ProxyPassReverse/https://backendEC2_9:443/
ProxyPassReverse/https://backendEC2_10:443/
目前我已经在虚拟工作者中设置了上述参数,并使用了重试参数。通过这些设置,请求将被切断,但大多数情况下,服务页面最多需要15分钟。

对于给定的场景,什么是最好的vhost配置?

下面的配置适合我

<Proxy balancer://AWSELB>
BalancerMember https://backendEC2_1:443 connectiontimeout=1
BalancerMember https://backendEC2_2:443 connectiontimeout=1
BalancerMember https://backendEC2_3:443 connectiontimeout=1
BalancerMember https://backendEC2_4:443 connectiontimeout=1
BalancerMember https://backendEC2_5:443 connectiontimeout=1
BalancerMember https://backendEC2_6:443 connectiontimeout=1
BalancerMember https://backendEC2_7:443 connectiontimeout=1
BalancerMember https://backendEC2_8:443 connectiontimeout=1
BalancerMember https://backendEC2_9:443 connectiontimeout=1
BalancerMember https://backendEC2_10:443 connectiontimeout=1
</Proxy>

ProxyPass / balancer://AWSELB/
ProxyPassReverse / balancer://AWSELB/

平衡员https://backendEC2_1:443 connectiontimeout=1
平衡员https://backendEC2_2:443 connectiontimeout=1
平衡员https://backendEC2_3:443 connectiontimeout=1
平衡员https://backendEC2_4:443 connectiontimeout=1
平衡员https://backendEC2_5:443 connectiontimeout=1
平衡员https://backendEC2_6:443 connectiontimeout=1
平衡员https://backendEC2_7:443 connectiontimeout=1
平衡员https://backendEC2_8:443 connectiontimeout=1
平衡员https://backendEC2_9:443 connectiontimeout=1
平衡员https://backendEC2_10:443 connectiontimeout=1
ProxyPass/balancer://AWSELB/
ProxyPassReverse/balancer://AWSELB/
使用connectiontimeout参数,如果在1秒内未连接到后端,则选择下一个工作进程,依此类推,直到找到健康工作进程


请注意,诸如MaxTest、timeout等设置将具有默认值,如中所述。活动后端节点的更改频率如何?我们无法控制后端何时更改。您是否可以升级到最新的Apache?是的,这个模块可以满足我的需要,但是我们不能更新我们的Apache主要版本。