开发者社区> 问答> 正文

haproxy并发请求的问题? 400 报错

haproxy并发请求的问题? 400 报错

发现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
 

展开
收起
爱吃鱼的程序员 2020-06-03 15:08:38 954 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    官方文档中有一段

    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.

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

     

    2020-06-03 16:39:27
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载