blob: 99be1cdd60e44c70f531c15a12c111c46e34299d [file] [log] [blame]
Willy Tarreau5c017822014-10-28 15:58:25 +010012014/10/28 - Server connection sharing
2
3For HTTP/2 we'll have to use multiplexed connections to the servers and to
4share them between multiple streams. We'll also have to do this for H/1, but
5with some variations since H1 doesn't offer connection status verification.
6
7In order to validate that an idle connection is still usable, it is desirable
8to periodically send health checks over it. Normally, idle connections are
9meant to be heavily used, so there is no reason for having them idle for a long
10time. Thus we have two possibilities :
11
12 - either we time them out after some inactivity, this saves server resources ;
13 - or we check them after some inactivity. For this we can send the server-
14 side HTTP health check (only when the server uses HTTP checks), and avoid
15 using that to mark the server down, and instead consider the connection as
16 dead.
17
18For HTTP/2 we'll have to send pings periodically over these connections, so
19it's worth considering a per-connection task to validate that the channel still
20works.
21
22In the current model, a connection necessarily belongs to a session, so it's
23not really possible to share them, at best they can be exchanged, but that
24doesn't make much sense as it means that it could disturb parallel traffic.
25
26Thus we need to have a per-server list of idle connections and a max-idle-conn
27setting to kill them when there are too many. In the case of H/1 it is also
28advisable to consider that if a connection was created to pass a first non-
29idempotent request while other idle connections were still existing, then a
30connection will have to be killed in order not to exceed the limit.
31