2
votes

In Kafka cluster with a defined quotas, in order to control the broker resources that are used by clients a broker computes the amount of delay needed to bring the violating client under its quota and returns a response with the delay immediately Source from Kafka apache documentation.

In this topic, I would know what does delay refered to (with concret example please)?

In my knowleage, when we define for example the producer_byte_rate=1024, the broker monitors the producer to not override the 1024o/sec, if the producer overrides the 1024o/sec the broker gonna bring down the client under its quota by throttling the pipe reserved for that client.

1

1 Answers

2
votes

The behavior when hitting a client hits the quota changed recently

Since Kafka 2.0: When a broker detects a client is violating a quota, the broker compute the delay required to bring the client back within its allowed quota and replies immediately (including the computed delay in the response). The broker then mutes the client socket so it won't process any more requests from this client for the duration of the delay.

Upon receiving a response with a throttle time, a "good" client should wait to delay before trying to send more requests. Any requests sent during this duration are ignored by the broker.

Before 2.0.0: Upon violation, instead of replying immediately, the broker was waiting for the throttle duration and only sending a response to the client after.