[英]Haproxy: Contents load after "timeout server" hit
我是 haproxy 世界的新手。 我將其用作具有以下設置的負載均衡器:
我設法設置了測試所需的所有內容,但是當我使用負載均衡器打開網站 (Roundcube) 時,一些內容仍處於待定狀態,直到超時服務器設置命中。 在那之后,內容繼續正確加載(它可能發生在多個文件中,tipically.js)。
日志,超時后,返回如下幾行:
Dec 30 15:54:27 lb haproxy\[513\]: [my.public.ip.addr:61687](https://my.public.ip.addr:61687) \[30/Dec/2022:15:54:21.210\] webmail-fe webmail-be/webmail1 0/0/1/3/6005 200 7804 - - sDVN 6/6/4/4/0 0/0 "GET /plugins/jqueryui/themes/elastic/jquery-ui.min.css?s=1658607433 HTTP/1.1"
那個 sDVN,如果我做對了,意味着網絡服務器沒有回復任何數據然后它被殺死了( https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#8.5 ):
s:等待服務器發送或接收數據時服務器端超時已過期。
D: session 被 haproxy 殺死,因為服務器被檢測到關閉並且被配置為在關閉時關閉所有連接。
在網絡服務器上,相應的 HTTP 請求:
webmail1.local - - [30/Dec/2022:15:54:21 +0100] "GET /plugins/jqueryui/themes/elastic/jquery-ui.min.css?s=1658607433 HTTP/1.1" 200 7848 "http://loadbalancer.local/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
如果我直接在網絡服務器上訪問網站,一切正常,無需等待。 所有服務器都通過局域網連接,沒有延遲或丟包。
我將不勝感激任何提示或幫助。 如果需要更多信息,我會盡快收集。
這是我的配置:
global
maxconn 5000
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 3s
timeout client 6s
timeout server 6s
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend webmail-fe
bind *:80
mode http
default_backend webmail-be
backend webmail-be
balance leastconn
option forwardfor
cookie SERVERUSED insert indirect nocache
# http-request cache-use webmail-cache
# http-response cache-store webmail-cache
# http-request set-header X-Forwarded-Port %[dst_port]
# http-request add-header X-Forwarded-Proto https if { ssl_fc }
# option httpchk HEAD / HTTP/1.1\r\nHost:localhost
option httpchk HEAD /
default-server check maxconn 50
server webmail1 webmail1.local:8080 cookie webmail1
# server webmail2 192.168.0.53:8080 cookie webmail2
# listen stats
# bind :32700
# stats enable
# stats uri /
# stats hide-version
# stats auth someuser:password
#cache webmail-cache
# total-max-size 128
# max-object-size 1000
# max-age 14
沒有來自網絡服務器的錯誤日志或 haproxy 上的任何 strage 日志,除了已經發布的行。 沒有使用 ss 的掛起連接或使用 tcpdump 看到的任何明顯問題
我希望,由於連接很少(這是一個測試環境)和小型 webapp,所以所有資源都可以像直接訪問跳過負載均衡器一樣快速加載。
升級到 haproxy 2.4,現在一切正常!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.