关于以haproxy作为中间层的mongodb连接定时断开问题
ipkfc 2016-06-17 04:35:57 使用mongoose连接mongodb数据库,以haproxy作为中间层,配置:
defaults
log global
option dontlognull
option tcplog
option clitcpka
option tcpka
option srvtcpka
maxconn 2000
retries 3
timeout queue 5m
timeout connect 30s
timeout client 5m
timeout server 5m
timeout http-keep-alive 10s
timeout check 10s
timeout client-fin 30s
timeout server-fin 30s
stats enable
balance roundrobin
frontend mongodb
bind x.x.x.x:port
mode tcp
bind localhost:port
default_backend mongodb
...
连接建立后,5分钟断开,查看log信息显示状态码为cD,如果client timeout时间调大,则是sD;
如果将 timeout client,timeout server去掉,程序会恢复正常,但haproxy会报warning,建议将加上;
有没有哪位大神碰到过,求指导下,多谢!!!急