Nginx系列-负载均衡超时时间


负载均衡重要的超时时间

1.proxy_connect_timeout:  连接超时时间,默认是60S

2.proxy_read_timeout:    真实服务器处理超时时间,默认是60S

3.proxy_send_timeout:    发送超时时间,默认是60S

 

Http负载均衡的内置高可用性

1.连接失败或者超时自动转到下一台服务器,有风险,建议关闭。因为会产生两次处理

 

禁用Nginx的默认高可用性
1. proxy_next_upstream off;

 

upstream web{ server 192.168.30.11:80 max_fails=1 fail_timeout=30; #设置失败1次,30s内不在往这台设备转发 server 192.168.30.11:81 max_fails=1 fail_timeout=30; } server { listen 89; location / {
proxy_connect_timeout 30s proxy_read_timeout 30s;
proxy_send_timeout 30s;
proxy_next_upstream off; proxy_pass http:
//web; } }

 

Haproxy和Nginx的高可用性实现对比
1. Haproxy不管在无请求有请求的情况下,会一直检测后端真实服务器,有问题会移出
2. Nginx如果后端真实服务器挂的情况下,proxy_next_stream关闭的话,影响是比较大的。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM