7 Kafka Throttling Properties

This topic provides information about configuring Kafka delivery throttling in plato-edp-services, including throttling properties, TPS tuning, validation rules, and downstream backpressure handling.

Overview

plato-edp-services now supports configurable Kafka delivery throttling. These properties allow administrators to enable throttling and control the allowed throughput when throttling is active.

Throttling is intended to slow down delivery to a consumer service after EDP identifies a downstream throttling condition, such as an OBRH response status configured as a throttling status.

Configuration Maintenance

Users can update these properties from Modify Config Properties by selecting the application name as plato-edp-services.

Figure 7-1 Modify Config Properties



No code change is required to tune the throttling rate. Update the required property values in Modify Config Properties and save.

Table 7-1 Newly added Throttling Properties

Property Default Description
edp.kafka.throttling.enabled false Enables or disables Kafka delivery throttling for plato-edp-services.
edp.kafka.throttling.provider coherence-throttling Selects the throttling state provider. Supported configured providers are coherence-throttling and db-throttling.
edp.kafka.throttling.capacity 100 Maximum tokens that the throttle bucket can hold. This controls the allowed burst size during throttling.
edp.kafka.throttling.refillTokens 1 Number of tokens added back to the bucket on each refill cycle. This is the main control for throttled TPS.
edp.kafka.throttling.refillDurationMs 500 Refill cycle duration in milliseconds. This is the time window used with refillTokens to calculate throttled TPS.
edp.kafka.throttling.ttl 600000 Duration, in milliseconds, for which a throttling entry remains active. Default is 10 minutes.
edp.kafka.throttling.obrhThrottleStatusCodes 429,0 OBRH response status codes that activate throttling. 429 represents too many requests. 0 represents timeout. Additional codes can be configured as a comma-separated list.

Controlling TPS During Throttling

During active throttling, each Kafka delivery attempt consumes one token. Tokens are refilled based on edp.kafka.throttling.refillTokens and edp.kafka.throttling.refillDurationMs.

Use this formula to estimate throttled TPS: TPS = (refillTokens / refillDurationMs) * 1000

Table 7-2 Example

Target behavior refillTokens refillDurationMs Approximate throttled TPS
2 message per second 1 500 2 TPS
5 message per second 5 1000 5 TPS
10 message per second 10 1000 10 TPS
20 message per second 10 500 20 TPS

To increase TPS during throttling, increase edp.kafka.throttling.refillTokens or decrease edp.kafka.throttling.refillDurationMs.

To decrease TPS during throttling, decrease edp.kafka.throttling.refillTokens or increase edp.kafka.throttling.refillDurationMs.

Validation Rules

Throttling is applied only when the configuration is valid:

Table 7-3 Validation Rules

Rule Required Value
edp.kafka.throttling.capacity Greater than 0
edp.kafka.throttling.refillTokens Greater than 0
edp.kafka.throttling.refillDurationMs Greater than 0
edp.kafka.throttling.ttl Greater than edp.kafka.throttling.refillDurationMs

If the configuration is invalid, plato-edp-services logs a warning and allows delivery without throttling.

Recommended Tuning Approach

  1. Enable throttling with edp.kafka.throttling.enabled=true.
  2. Start with a conservative TPS by setting refillTokens and refillDurationMs.
  3. Monitor downstream consumer behavior and Kafka retry backlog.
  4. Increase or decrease TPS using the formula above.
  5. Keep capacity aligned with the acceptable burst size for the consumer service.

Figure 7-2 Configuring Exception Handling for a Service Provider



Note:

We should propagate exception status code from OBRH to EDP for which 'Propagate failed response' flag needs to be toggled on under configurations of Service Provider. If not done, the exception status code won't reach EDP and Throttling would not work.