Enable Bulkhead
Bulkhead configuration allows you to specify the maximum number of concurrent requests processed by an API. You can configure this setting individually for an API or globally for all APIs.
When the number of concurrent requests to an API exceeds the specified limit, the excess requests are rejected. In such scenarios, the policy violation events are generated to report the violations occurred for an API. If there are 100 violations, then 100 policy violation events are generated.
As per the order of policies, the Bulkhead limit policy is applied first. That is, if you have applied multiple policies including the Bulkhead limit policy, then the Bulkhead limit policy is applied first.
Why do we configure bulkhead limit for APIs?



This ensures optimal usage of the system resources.
- Bulkhead limit
for an API at the API level. Specifies the maximum concurrent
request limit for an API, exceeding which the requests are rejected. This
number does not include the callbacks that an API receives. So, you can
separately specify the maximum concurrent callbacks that an API can handle. The
503 Service unavailable
error code is sent to the client service when the requests are rejected. You can configure the required error code and status phrase using the extended settings. You can customize the required status code and message using the extended settings pg.bulkhead.statusCode and pg.bulkhead.statusMessage respectively. - Bulkhead limit
for all APIs (Global policy). Specifies the maximum concurrent
request limit for all APIs. Similar to the API level configuration, you can
provide the maximum concurrent callbacks and your choice to retry the rejected
requests.
When you have configured global-level bulkhead limit for APIs, and if you configure a different bulkhead limit at an API-level, then the limit configured at the global level takes precedence. To override this, you must exclude the required APIs from the global-policy using filters. You can apply the required API filters when creating or editing the bulkhead global policy. For information about creating global policies and applying API filters, see Creating a Global Policy.
- Add Retry-After response header. Specifies whether the Retry-After header must be included in the response sent to the client when requests are rejected. If you select to add, you must also specify the duration (in seconds) that the system must wait before sending the consecutive requests. You can configure this setting to keep the client informed on the waiting duration before processing the consecutive requests.