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
官方文档中有一段
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.
但是不知道怎么配置才能达到这个效果
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。