logoalt Hacker News

dotwaffletoday at 3:01 AM2 repliesview on HN

I've never quite understood why there couldn't be a standardised "reverse" HTTP connection, from server to load balancer, over which connections are balanced. Standardised so that some kind of health signalling could be present for easy/safe draining of connections.


Replies

snowhaletoday at 4:24 AM

gRPC's health checking protocol (https://github.com/grpc/grpc/blob/master/doc/health-checking...) is roughly this -- servers expose a standard health streaming endpoint the LB can subscribe to, and servers can send SERVING/NOT_SERVING signals proactively when they want to drain. not universally adopted and HTTP/1 has nothing equivalent, but the spec exists for the server-initiated signaling direction.

bastawhiztoday at 3:46 AM

Whether the load balancer connects to the server or reverse, nothing changes. A modern H2 connection is pretty much just that: one persistent connection between the load balancer and server, who initiates it doesn't change much.

The connection being active doesn't tell you that the server is healthy (it could hang, for instance, and you wouldn't know until the connection times out or a health check fails). Either way, you still have to send health checks, and either way you can't know between health checks that the server hasn't failed. Ultimately this has to work for every failure mode where the server can't respond to requests, and in any given state, you don't know what capabilities the server has.