Hi Tim,

On Wed, Nov 27, 2019 at 08:21:19PM +0100, Tim Düsterhus wrote:
> Dear List
> for one project I put an HAProxy HTTPS frontend in front of two backends
> currently containing a single server each.
> The nginx backend sits in front of a PHP application with a small number
> of workers. Because HAProxy handles queuing better than nginx I limited
> the nginx server to maxconn = 50.
> Now the question: How many in-flight requests will be passed in peak
> situations to nginx when I enable clear text HTTP/2 between HAProxy and
> nginx for that maxconn = 50 server?
> a) Is it 50 in-flight requests over a possibly smaller number of HTTP/2
> connections? (requests <= 50)

Yes that's it. Since we've started to support server-side keep-alive
in 1.5, the maxconn setting really sets the limit to the number of in
outstanding requests to a server. Technically speaking it limits the
number of streams attached to a server. In a multiplexed connection,
you will have anywhere between 1 and 50 connections for 50 streams.

This was absolutely important because for most backends, the cost of
processing a request is way higher than the cost of an idle connection,
so what we really need to limit is the amount of parallel work delivered
to each server. In addition it's the only solution which guarantees the
same distribution for H1/close, H1/keep-alive, http-reuse, H2, etc.

Hoping this helps,

Reply via email to