haproxy并发请求的问题

hong_derek 发布于 2017/04/19 19:51
阅读 448
收藏 0

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

加载中
0
hong_derek
hong_derek

官方文档中有一段

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.

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

 

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部