haproxy并发请求的问题

发布于 2021-12-04 17:51:22 字数 605 浏览 746 评论 1

发现haproxy当后端收到请求没有没有返回应答前,前端收到的第二个请求不会发送到后端。

结果就是前端收到的请求全部串行发送到后端。

是否有相关设置解决该问题?

 

配置文件

global
    daemon
    maxconn 256

defaults
    mode http
    timeout connect 5000
    timeout client 50000
    timeout server 50000

frontend http_front
    bind *:8080
    stats uri /haproxy?stats
    default_backend http_back

backend http_back
    server node1 172.31.32.47:8080 maxconn 32
 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情空心 2021-12-05 11:14:21

官方文档中有一段

A last improvement in the communications is the pipelining mode. It still uses
keep-alive, but the client does not wait for the first response to send the
second request. This is useful for fetching large number of images composing a
page :

  [CON] [REQ1] [REQ2] ... [RESP1] [RESP2] [CLO] ...

This can obviously have a tremendous benefit on performance because the network
latency is eliminated between subsequent requests. Many HTTP agents do not
correctly support pipelining since there is no way to associate a response with
the corresponding request in HTTP. For this reason, it is mandatory for the
server to reply in the exact same order as the requests were received.

但是不知道怎么配置才能达到这个效果

 

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文