For developers building cloud-native microservices, an increasingly common choice is to use gRPC, a high-performance, open-source RPC framework that you can use with Traffic Director for your service mesh. Last year, the gRPC community introduced support for the xDS APIs, bringing service mesh capabilities to proxyless gRPC services. With the most recent release of gRPC, we are adding support for three new capabilities: maximum stream duration (timeout), circuit breaking, and fault injection, enabling you to improve the reliability of your microservices. If you’re already using Traffic Director with proxyless gRPC services, you can add these capabilities via a simple API call. Let’s take a look at these new capabilities.
Stop misbehaving calls with maximum stream duration
The addition of maximum stream duration allows you to configure time limits for all RPCs within the mesh. This feature can be used to ensure clients abort operations that are running unusually slowly when it is unlikely they will succeed, enabling them to try another backend or report an error more quickly. The new xDS maximum stream duration is well integrated with gRPC’s per-RPC deadline, which is set by the client application. When both of them are configured, the effective timeout of requests will be the smaller of the two, respecting the requirements for both the service manager and the client application.
From our partners:
Prevent request flooding with circuit breakers
Circuit breaking can be used to control the maximum number of simultaneous RPCs allowed from each client to your service. This helps prevent excessive load that, if unchecked, could cause a widespread service outage. With circuit breakers, new RPCs won’t be sent out if the client has reached the limit of outstanding requests specified by the service manager. Compared to server-side rate limiters, which deny incoming requests when the server is experiencing heavy load, excessive RPCs are throttled by the clients, so no network or service resources will be consumed.
Provision system robustness with fault injection tests
Fault injection provides a way to test the resiliency of microservices in the presence of different types of failures. With this feature, you can artificially delay or fail a percentage of RPCs to determine how well your system handles these scenarios before they happen due to a real production event. Fault injection can be configured for all RPCs or a specific set of requests based on headers set by clients. This gives you the ability to stage different failure scenarios without completely bringing down the production service.
If you’ve been thinking about adopting a service mesh, improving performance, or increasing the reliability of your system, proxyless gRPC and Traffic Director can help you do that. Once you have proxyless gRPC applications set up with Traffic Director, you can enable the above reliability features on all your applications via a single API call, as opposed to having to code each application independently.
For more information about using gRPC with Traffic Director and these new features, see the following links:
By: Doug Fawley (Engineering Lead, gRPC) and Chengyuan Zhang (Software Engineer, gRPC)
Source: Google Cloud Blog
For enquiries, product placements, sponsorships, and collaborations, connect with us at email@example.com. We'd love to hear from you!
Our humans need coffee too! Your support is highly appreciated, thank you!