Skip to content

Commit

Permalink
in_kafka: Rely on only buffer_max_size for preventing greedy consumin…
Browse files Browse the repository at this point in the history
…g topics

Referring Mem_Buf_Limit and relying on pause/resume should cause
performance degredation.
Only relying on buffer_max_size should be better to adjust flow rate.

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Nov 17, 2023
1 parent 08e0de5 commit 5f18744
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/in_kafka/in_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,8 @@ static int in_kafka_init(struct flb_input_instance *ins,
goto init_error;
}

if (ctx->ins->mem_buf_limit > 0 || ctx->buffer_max_size > 0) {
if (ctx->ins->mem_buf_limit) {
ctx->polling_threshold = ctx->ins->mem_buf_limit;
}
else if (ctx->buffer_max_size > 0) {
if (ctx->buffer_max_size > 0) {
if (ctx->buffer_max_size > 0) {
ctx->polling_threshold = ctx->buffer_max_size;
}

Expand Down

0 comments on commit 5f18744

Please sign in to comment.