8. Using the Bulkhead Isolation Policy to Keep Your Application Up Flashcards
Is the Bulkhead Isolation
policy a reactive or a proactive strategy?
It’s a proactive one.
What does the Bulkhead Isolation
policy help us achieve?
Keeping our application stable when under heavy load or when a service it relies on is responding too slowly or has gone down.
What can the Bulkhead Isolation
policy be used for?
It can be used for resource sharing, load shedding, or as a trigger for horizontal scaling.
How does the Bulkhead Isolation
policy work when it comes to resource allocation?
It allows us to allocate and define a set of resources for a given task rather than letting that task take all the resources it can.
How does the Bulkhead Isolation
policy affect how quickly our application fails and what does this mean when it comes to scaling?
It lets us fail fast by rejecting incoming requests and by monitoring the utilization of the bulkhead. Based on this monitor, we can potentially trigger a horizontal scaling process.
What negative situation does the Bulkhead Isolation
policy help us prevent?
If one part of the application is overloaded, it can bring down other parts. The Bulkhead Isolation
policy can prevent that from happening, or at the very least, delay it.
What’s the primary purpose of the Bulkhead Isolation
policy and what is its secondary use case?
The primary purpose of this policy is to prevent application overloading. Its secondary use case is resource allocation.
How is scaling achieved using the Bulkhead Isolation
policy?
By monitoring your Bulkhead Isolation
policies, you can determine the number of ongoing parallel requests, as well as the number of requests waiting in the queues. When you reach some limit, you can trigger horizontal scaling and spin up another instance of your application.
How is load shedding achieved using the Bulkhead Isolation
policy?
It is better to fail fast than to fail unpredictably. When your application is being overwhelmed by requests, at some unknown point, it will slow and subsequently fail.
With the Bulkhead Isolation
policy, you can set when your application stops accepting requests and immediately returns an error to the caller.
Can the Bulkhead Isolation
policy be used in conjunction with other policies?
Yes. A common example is to use a Fallback
policy when you reach the point of load shedding.
What factors should we look to balance when it comes to implementing the Bulkhead Isolation
policy for our app?
We need to strike a balance between protecting our application, allowing it to perform close to to the limit of its ability, complexity of our codebase, and cost.
What are the parameters for setting up a Bulkhead Isolation
policy?
There are three.
- Number of execution slots (int, required).
- Size of the queue that’ll be available (int, required).
- The method to call when the queue and the execution slots are both full (delegate, optional).
What Policy
methods can we use to define a Bulkhead Isolation
policy?
The generic or the non-generic versions of either the Bulkhead
or the BulkheadAsync
methods.
Policy.BulkheadAsync(
2, 4, OnBulkheadRejectedAsync);