大网数据广告活动
服务器运维问答

Explanation of HAProxy Stats Page Backend Queue Values

· 52CE 我爱测

As shown in the image below, I have a HAProxy backend with 2 servers which have the following settings: maxconn 64 check inter 5s fastinter 2s downinter 2s My question regards the Queue column. How can I specify the limit of the …

问题原文

原帖链接 · cherouvim · CC BY-SA 3.0

As shown in the image below, I have a HAProxy backend with 2 servers which have the following settings:

maxconn 64 check inter 5s fastinter 2s downinter 2s

My question regards the Queue column. How can I specify the limit of the backend queue? And why does the Backend at the bottom, show the value of 11 when api-1 and api-2 show 22 and 18 respectively? What does the number 11 represent in my case?

已采纳解答

原帖链接 · Mo3m3n · CC BY-SA 3.0

Question 1/
As mentioned by Willy in this thread: https://www.mail-archive.com/[email omitted]/msg21521.html , you can't specify maxqueue for a backend but you can do it for backend's servers.

First let's make it clear about queues: There is a per-backend queue and a per-server queue. Connections with a server persistence go to the server (in question) queue and other connections go to the backend queue.

When a server maxqueue is reached, the HAProxy doc http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#5.2-maxqueue says that

If this limit is reached, next requests will be redispatched to other servers instead of indefinitely waiting to be served. This will break persistence but may allow people to quickly re-log in when the server they try to connect to is dying.

So next requests won't be lost in this case.

It would be different if a supposed backend maxqueue is reached and clients may get errors in return. Thus, To avoid this, there is no backend maxqueue implementation but you still can achieve the same behavior using a rule in the backend like this:

backend foo
      tcp-request content reject if { queue ge 100 }

Question 2/
The column Max Queue tells the Maximum Queue size reached since the last HAProxy reload.
So 11 is the Maximum Queue size reached by your backend. This is different from the Max Queue size of your servers because, as said earlier, backend queue and servers queues are separated.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-03-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。