Hi Maksim, On Thu, Jan 21, 2021 at 09:27:33PM +0300, ?????? ????????? wrote: > Hi! > > Can anyone please explain or point out in the documentation how streams in > HTTP/2 connection are balanced?
Like any other HTTP stream. There's no relation between H2 streams. There was already no relation between H1 streams, but it was possible to know that one of them was the first one. For H2 there's no first one at all since they're all parallel. > Right now I have haproxy=2.1.4 with http/2 balancer configured and it seems > to me that gRPC-requests over a single connection from a client are always > forwarded to the same backend server. > > Am I right or not? Are there any configuration options for this? Not only there is no reason for this, but if you asked me how to achieve this I wouldn't know how to do it :-) The load balancing happens for each request, following the configured LB algorithm. > Forget to add my config. It looks like this one (http/2 end to end, no ssl, > random balanced): > > frontend grpc.service:8080 > bind ipv6@xxx:8080 proto h2 > > mode http > option http-use-htx > timeout client 30s > > default_backend be1:grpc.service:8080 > > backend be1:grpc.service:8080 > mode http > balance random > > retries 1 > timeout connect 25 > timeout server 30s > timeout queue 1s > > # Set other options > option http-use-htx > option redispatch > > default-server weight 50 > > server server1:17355 xxx:17355 proto h2 > server server2:17355 yyy:17355 proto h2 > server server3:17355 zzz:17355 proto h2 I see nothing wrong in this config, for me it's OK. However, is there any reason for you to run on a version that's affected by 221 known bugs ? Maybe what you're observing is just the consequence of one of these ? https://www.haproxy.org/bugs/bugs-2.1.4.html Please update it and retry, just in case. Cheers, Willy