Search This Blog

Saturday, April 17, 2010

Release It! - Chapter 5.6 Handshaking

Handshaking is signaling between devices that regulate communication between them.  Handshaking is found in most low-level protocols but not in the higher level ones.  HTTP has a variety of codes but most developers just look for 200 OK.  Handshaking is about letting the server protect itself by throttling its own workload.  The server should have a way to reject work if it cannot handle it.  You can achieve this by combining load balancers and web servers where the web server returns a 503 NOT AVAILABLE message to the load balancer when it makes its "are you still alive" requests.  In SOA, you might want to provide a "health check" service that the clients can call before trying the real service.  You get good handshaking but double the number of calls.  Handshaking can help when Unbalanced Capacities trigger Slow Responses because the server can tell the client that it can't meet its SLA and should back off.  If you can't use Handshaking, then Circuit Breaker might work.  Your best bet is to build handshaking into any custom protocols that you invent.
  • create cooperative demand control - both the client and server sides need to understand and respect the Handshaking if it is to work
  • consider health checks - if you can't tweak the protocol then maybe you can add a health check service.  You need to weigh the cost of the extra calls against the service failing.
  • build Handshaking into your own low-level protocols - if you make your own socket protocol, make sure to add Handshaking into it so the endpoints can notify others when they can't accept more work.

No comments:

Post a Comment